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