Parcourir la source

消息输入框安全区适配

zwp il y a 5 mois
Parent
commit
29cd842e54
2 fichiers modifiés avec 16 ajouts et 3 suppressions
  1. 6 2
      AIIM.xcodeproj/project.pbxproj
  2. 10 1
      AIIM/Controller/chat/ChatController.m

+ 6 - 2
AIIM.xcodeproj/project.pbxproj

@@ -220,9 +220,13 @@
 			);
 			inputFileListPaths = (
 			);
+			inputPaths = (
+			);
 			name = "[CP] Embed Pods Frameworks";
 			outputFileListPaths = (
 			);
+			outputPaths = (
+			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
 			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-AIIM/Pods-AIIM-frameworks.sh\"\n";
@@ -251,7 +255,7 @@
 				CODE_SIGN_ENTITLEMENTS = AIIM/AIIM.entitlements;
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Manual;
-				CURRENT_PROJECT_VERSION = 20336;
+				CURRENT_PROJECT_VERSION = 20337;
 				DEVELOPMENT_TEAM = "";
 				"DEVELOPMENT_TEAM[sdk=iphoneos*]" = ANJCTZ9L4P;
 				ENABLE_DEBUG_DYLIB = NO;
@@ -306,7 +310,7 @@
 				CODE_SIGN_ENTITLEMENTS = AIIM/AIIM.entitlements;
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Manual;
-				CURRENT_PROJECT_VERSION = 20336;
+				CURRENT_PROJECT_VERSION = 20337;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEVELOPMENT_TEAM = "";
 				"DEVELOPMENT_TEAM[sdk=iphoneos*]" = ANJCTZ9L4P;

+ 10 - 1
AIIM/Controller/chat/ChatController.m

@@ -120,6 +120,11 @@ static const CGFloat kQuoteViewHeight = 46.0f;
     self._tableView.dataSource = self;
     _isfriend=true;
     
+    CGFloat safeBottom = [UIDevice safeDistanceBottom];
+    UIView *temp = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 60+safeBottom)];
+    temp.backgroundColor = UIColor.blackColor;
+    [_bottonView insertSubview:temp atIndex:0];
+    
     //输入框
     _inputView = [[MentionTextView alloc] initWithFrame:CGRectMake(54, 10, self.view.frame.size.width - 180, 40)];
     _inputView.backgroundColor = globalColor(GCTypeDark2);
@@ -1050,6 +1055,9 @@ static const CGFloat kQuoteViewHeight = 46.0f;
     // 根据需要调整视图大小或位置(例如,移动某个视图)
     // 示例:将一个视图向下移动以适应键盘高度
 
+    CGFloat safeBottom = [UIDevice safeDistanceBottom];
+    CGFloat offsetY = _keyboardHeight - safeBottom;
+    
     _gengduoBt.alpha = 1;
     _fasngBt.alpha = 1;
     _keybarShow=true;
@@ -1057,7 +1065,7 @@ static const CGFloat kQuoteViewHeight = 46.0f;
                           delay:0
                         options:UIViewAnimationOptionCurveEaseInOut
                      animations:^{
-        self.inputViewBottom.constant = self.keyboardHeight;
+        self.inputViewBottom.constant = offsetY;
         [self.view setNeedsLayout];
         [self.view layoutIfNeeded];
     } completion:^(BOOL finished) {
@@ -1265,6 +1273,7 @@ static const CGFloat kQuoteViewHeight = 46.0f;
             self.isQuoteMessage = NO;
         }
         _inputView.text=@"";
+        [self textViewDidChange:_inputView];
     }
     if(_keybarShow){
         _gengduoBt.alpha = 1;