修复退出房间的时候键盘无法收回的问题
This commit is contained in:
@@ -28,6 +28,7 @@
|
|||||||
- (instancetype)initWithFrame:(CGRect)frame {
|
- (instancetype)initWithFrame:(CGRect)frame {
|
||||||
self = [super initWithFrame:frame];
|
self = [super initWithFrame:frame];
|
||||||
if (self) {
|
if (self) {
|
||||||
|
self.tag = 888;
|
||||||
[self initSubViews];
|
[self initSubViews];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
@@ -45,6 +46,7 @@
|
|||||||
self.messageWindow.rootViewController = nil;
|
self.messageWindow.rootViewController = nil;
|
||||||
self.messageWindow.windowLevel = -1;
|
self.messageWindow.windowLevel = -1;
|
||||||
self.messageWindow = nil;
|
self.messageWindow = nil;
|
||||||
|
[[NSNotificationCenter defaultCenter] postNotificationName:@"roomMessageTabelViewStopScroll" object:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Getters And Setters
|
#pragma mark - Getters And Setters
|
||||||
@@ -59,6 +61,7 @@
|
|||||||
_dismissView.backgroundColor = [UIColor clearColor];
|
_dismissView.backgroundColor = [UIColor clearColor];
|
||||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissViewTap)];
|
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissViewTap)];
|
||||||
[_dismissView addGestureRecognizer:tap];
|
[_dismissView addGestureRecognizer:tap];
|
||||||
|
_dismissView.tag = 8888;
|
||||||
}
|
}
|
||||||
return _dismissView;
|
return _dismissView;
|
||||||
}
|
}
|
||||||
|
@@ -149,8 +149,8 @@
|
|||||||
|
|
||||||
|
|
||||||
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
|
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
|
||||||
///666是外部的公屏消息列表
|
///666是外部的公屏消息列表 8888房间半屏弹框顶部消失的view
|
||||||
if (otherGestureRecognizer.view.tag == 666) {
|
if (otherGestureRecognizer.view.tag == 666 || otherGestureRecognizer.view.tag == 8888) {
|
||||||
self.scrollEnabled = NO;
|
self.scrollEnabled = NO;
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
@@ -14,6 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
@interface XPRoomMenuContainerView : UIView<RoomGuestDelegate>
|
@interface XPRoomMenuContainerView : UIView<RoomGuestDelegate>
|
||||||
|
|
||||||
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate;
|
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate;
|
||||||
|
|
||||||
|
- (void)menuResignFirstResponder;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
@@ -56,6 +56,8 @@
|
|||||||
@property (nonatomic,strong) UIButton *arrangeMicButton;
|
@property (nonatomic,strong) UIButton *arrangeMicButton;
|
||||||
///贵族
|
///贵族
|
||||||
@property (nonatomic,strong) UIButton *nobleButton;
|
@property (nonatomic,strong) UIButton *nobleButton;
|
||||||
|
///输入框
|
||||||
|
@property (nonatomic,strong) XPRoomSendTextView *inputTextView;
|
||||||
@property (nonatomic,strong) XPRoomMessageBubbleView *miniMessageView;
|
@property (nonatomic,strong) XPRoomMessageBubbleView *miniMessageView;
|
||||||
///代理
|
///代理
|
||||||
@property (nonatomic,weak) id<RoomHostDelegate> delegate;
|
@property (nonatomic,weak) id<RoomHostDelegate> delegate;
|
||||||
@@ -74,6 +76,10 @@
|
|||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
- (void)menuResignFirstResponder {
|
||||||
|
[self.inputTextView.editTextFiled resignFirstResponder];
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Response
|
#pragma mark - Response
|
||||||
- (void)menuButtonAction:(UIButton *)sender {
|
- (void)menuButtonAction:(UIButton *)sender {
|
||||||
XPRoomMenuItemType type = sender.tag;
|
XPRoomMenuItemType type = sender.tag;
|
||||||
@@ -84,7 +90,7 @@
|
|||||||
[XCHUDTool showErrorWithMessage:@"房间公屏已关闭"];
|
[XCHUDTool showErrorWithMessage:@"房间公屏已关闭"];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
[XPRoomSendTextView showTextView:[UIApplication sharedApplication].delegate.window delegate:self.delegate atUid:nil atNick:nil];
|
self.inputTextView = [XPRoomSendTextView showTextView:[UIApplication sharedApplication].delegate.window delegate:self.delegate atUid:nil atNick:nil];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@@ -11,10 +11,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
@interface XPRoomSendTextView : UIView
|
@interface XPRoomSendTextView : UIView
|
||||||
|
|
||||||
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate;
|
- (instancetype) :(id<RoomHostDelegate>)delegate;
|
||||||
|
///输入框
|
||||||
|
@property (nonatomic, strong, readonly) UITextField *editTextFiled;
|
||||||
///发小消息的弹框
|
///发小消息的弹框
|
||||||
+ (void)showTextView:(UIView *)view delegate:(id<RoomHostDelegate>)delegate atUid:(NSString *)uid atNick:(NSString *)nick;
|
+ (instancetype)showTextView:(UIView *)view delegate:(id<RoomHostDelegate>)delegate atUid:(NSString *)uid atNick:(NSString *)nick;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@@ -196,7 +196,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Public Method
|
#pragma mark - Public Method
|
||||||
+ (void)showTextView:(UIView *)view delegate:(id<RoomHostDelegate>)delegate atUid:(NSString *)uid atNick:(NSString *)nick {
|
+ (instancetype)showTextView:(UIView *)view delegate:(id<RoomHostDelegate>)delegate atUid:(NSString *)uid atNick:(NSString *)nick {
|
||||||
__block XPRoomSendTextView * textView;
|
__block XPRoomSendTextView * textView;
|
||||||
[view.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
[view.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||||
if ([obj isKindOfClass:[XPRoomSendTextView class]]) {
|
if ([obj isKindOfClass:[XPRoomSendTextView class]]) {
|
||||||
@@ -209,6 +209,7 @@
|
|||||||
[view addSubview:textView];
|
[view addSubview:textView];
|
||||||
}
|
}
|
||||||
textView.hidden = NO;
|
textView.hidden = NO;
|
||||||
|
|
||||||
|
|
||||||
[textView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[textView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.right.bottom.mas_equalTo(view);
|
make.left.right.bottom.mas_equalTo(view);
|
||||||
@@ -222,6 +223,7 @@
|
|||||||
textView.inputMessage = textView.editTextFiled.text;
|
textView.inputMessage = textView.editTextFiled.text;
|
||||||
textView.sendButton.enabled = YES;
|
textView.sendButton.enabled = YES;
|
||||||
}
|
}
|
||||||
|
return textView;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Private Method
|
#pragma mark - Private Method
|
||||||
|
@@ -220,7 +220,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
|
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
|
||||||
[self.view endEditing:YES];
|
[self.menuContainerView menuResignFirstResponder];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewWillAppear:(BOOL)animated {
|
- (void)viewWillAppear:(BOOL)animated {
|
||||||
@@ -1229,6 +1229,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)exitRoom {
|
- (void)exitRoom {
|
||||||
|
[self.menuContainerView menuResignFirstResponder];
|
||||||
if (self.roomInfo.roomModeType == RoomModeType_Open_Micro_Mode || self.roomInfo.roomModeType == RoomModeType_Open_Blind) {
|
if (self.roomInfo.roomModeType == RoomModeType_Open_Micro_Mode || self.roomInfo.roomModeType == RoomModeType_Open_Blind) {
|
||||||
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.roomInfo.uid];
|
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.roomInfo.uid];
|
||||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||||
@@ -1339,6 +1340,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)miniRoom {
|
- (void)miniRoom {
|
||||||
|
[self.menuContainerView menuResignFirstResponder];
|
||||||
if(self.roomInfo.type == RoomType_MiniGame) {
|
if(self.roomInfo.type == RoomType_MiniGame) {
|
||||||
if ([self.littleGameView isInSudGame]) {
|
if ([self.littleGameView isInSudGame]) {
|
||||||
TTAlertConfig *config = [[TTAlertConfig alloc] init];
|
TTAlertConfig *config = [[TTAlertConfig alloc] init];
|
||||||
|
Reference in New Issue
Block a user