Explorar o código

聊天页面修改

zwp hai 5 meses
pai
achega
9af70e45da

+ 73 - 34
AIIM/Base.lproj/Main.storyboard

@@ -1298,32 +1298,27 @@
         <!--Chat Controller-->
         <scene sceneID="FbZ-UL-y99">
             <objects>
-                <viewController storyboardIdentifier="ChatController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="8Ne-KO-ISW" customClass="ChatController" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="ChatController" automaticallyAdjustsScrollViewInsets="NO" useStoryboardIdentifierAsRestorationIdentifier="YES" id="8Ne-KO-ISW" customClass="ChatController" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="PeG-ok-jF3">
                         <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <imageView clipsSubviews="YES" userInteractionEnabled="NO" tag="999" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="loginBG" translatesAutoresizingMaskIntoConstraints="NO" id="6ef-Pq-wwt">
+                            <imageView clipsSubviews="YES" userInteractionEnabled="NO" tag="999" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="loginBG" translatesAutoresizingMaskIntoConstraints="NO" id="6ef-Pq-wwt">
                                 <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
-                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                             </imageView>
-                            <tableView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="fIx-Pt-Uyr">
-                                <rect key="frame" x="0.0" y="102" width="375" height="646"/>
-                                <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
+                            <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="fIx-Pt-Uyr">
+                                <rect key="frame" x="0.0" y="64" width="375" height="543"/>
                                 <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                             </tableView>
-                            <view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1ZT-FI-RZH">
-                                <rect key="frame" x="0.0" y="571" width="375" height="96"/>
-                                <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
-                                <color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                            </view>
-                            <view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fb0-v7-JQg">
-                                <rect key="frame" x="0.0" y="579" width="375" height="62"/>
-                                <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fb0-v7-JQg">
+                                <rect key="frame" x="0.0" y="607" width="375" height="60"/>
                                 <subviews>
-                                    <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fqm-Wo-Kyd">
+                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fqm-Wo-Kyd">
                                         <rect key="frame" x="294" y="13" width="68" height="35"/>
-                                        <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
+                                        <constraints>
+                                            <constraint firstAttribute="width" constant="68" id="VBq-RZ-4Kw"/>
+                                            <constraint firstAttribute="height" constant="35" id="lpj-Kg-W5U"/>
+                                        </constraints>
                                         <state key="normal" title="Button"/>
                                         <buttonConfiguration key="configuration" style="tinted" title="发送">
                                             <fontDescription key="titleFontDescription" type="system" pointSize="17"/>
@@ -1334,10 +1329,13 @@
                                             <action selector="fasongBt:" destination="8Ne-KO-ISW" eventType="touchUpInside" id="8JE-4T-Yhg"/>
                                         </connections>
                                     </button>
-                                    <button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="fill" contentVerticalAlignment="fill" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="MD5-Ca-QNt">
-                                        <rect key="frame" x="8" y="10" width="44" height="44"/>
-                                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                                    <button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="fill" contentVerticalAlignment="fill" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="MD5-Ca-QNt">
+                                        <rect key="frame" x="8" y="15" width="32" height="32"/>
                                         <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="32" id="D7Y-3N-Jis"/>
+                                            <constraint firstAttribute="width" constant="32" id="Kb6-wy-bfE"/>
+                                        </constraints>
                                         <inset key="imageEdgeInsets" minX="2" minY="2" maxX="2" maxY="2"/>
                                         <state key="normal" image="yuyin"/>
                                         <connections>
@@ -1345,7 +1343,7 @@
                                         </connections>
                                     </button>
                                     <button opaque="NO" alpha="0.0" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="fill" contentVerticalAlignment="fill" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="IpD-B7-QDK">
-                                        <rect key="frame" x="254" y="8" width="44" height="44"/>
+                                        <rect key="frame" x="254" y="6" width="44" height="44"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
                                         <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                         <inset key="imageEdgeInsets" minX="7" minY="7" maxX="7" maxY="7"/>
@@ -1354,10 +1352,13 @@
                                             <action selector="biaoqingBt:" destination="8Ne-KO-ISW" eventType="touchUpInside" id="SdG-aa-7zX"/>
                                         </connections>
                                     </button>
-                                    <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="fill" contentVerticalAlignment="fill" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="CBU-HY-KvD">
-                                        <rect key="frame" x="254" y="9" width="44" height="44"/>
-                                        <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
+                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="fill" contentVerticalAlignment="fill" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="CBU-HY-KvD">
+                                        <rect key="frame" x="245" y="9" width="44" height="44"/>
                                         <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                        <constraints>
+                                            <constraint firstAttribute="width" constant="44" id="D3c-f4-qos"/>
+                                            <constraint firstAttribute="height" constant="44" id="uXq-1U-H1f"/>
+                                        </constraints>
                                         <inset key="imageEdgeInsets" minX="7" minY="7" maxX="7" maxY="7"/>
                                         <state key="normal" image="Cjiahao"/>
                                         <connections>
@@ -1365,27 +1366,44 @@
                                         </connections>
                                     </button>
                                 </subviews>
-                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                <color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                <constraints>
+                                    <constraint firstItem="CBU-HY-KvD" firstAttribute="centerY" secondItem="fqm-Wo-Kyd" secondAttribute="centerY" id="FcV-7g-0oj"/>
+                                    <constraint firstAttribute="trailing" secondItem="fqm-Wo-Kyd" secondAttribute="trailing" constant="13" id="PM9-Tc-6yR"/>
+                                    <constraint firstAttribute="height" constant="60" id="VXp-uj-aRX"/>
+                                    <constraint firstItem="MD5-Ca-QNt" firstAttribute="centerY" secondItem="CBU-HY-KvD" secondAttribute="centerY" id="d2m-mL-Zub"/>
+                                    <constraint firstAttribute="bottom" secondItem="fqm-Wo-Kyd" secondAttribute="bottom" constant="12" id="kAO-tf-IIP"/>
+                                    <constraint firstItem="MD5-Ca-QNt" firstAttribute="leading" secondItem="fb0-v7-JQg" secondAttribute="leading" constant="8" id="p5P-hB-Kmp"/>
+                                    <constraint firstItem="fqm-Wo-Kyd" firstAttribute="leading" secondItem="CBU-HY-KvD" secondAttribute="trailing" constant="5" id="ybr-K1-Ee3"/>
+                                </constraints>
                             </view>
-                            <label opaque="NO" userInteractionEnabled="NO" tag="999" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9dU-L3-mrV">
-                                <rect key="frame" x="91" y="66" width="214" height="21"/>
-                                <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
+                            <label opaque="NO" userInteractionEnabled="NO" tag="999" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9dU-L3-mrV">
+                                <rect key="frame" x="167" y="20" width="42" height="44"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="44" id="Ac6-DC-aG5"/>
+                                </constraints>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <button opaque="NO" tag="999" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="OFS-Oe-E3p">
-                                <rect key="frame" x="317" y="55" width="44" height="44"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+                            <button opaque="NO" tag="999" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="OFS-Oe-E3p">
+                                <rect key="frame" x="337" y="26" width="32" height="32"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="32" id="hfN-jg-RxZ"/>
+                                    <constraint firstAttribute="height" constant="32" id="lMo-SP-Cq3"/>
+                                </constraints>
                                 <state key="normal" title="Button"/>
                                 <buttonConfiguration key="configuration" style="plain" image="rightdian"/>
                                 <connections>
                                     <action selector="rightBt:" destination="8Ne-KO-ISW" eventType="touchUpInside" id="Oci-4k-42D"/>
                                 </connections>
                             </button>
-                            <button opaque="NO" tag="999" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="PMc-9Y-haA">
-                                <rect key="frame" x="20" y="55" width="44" height="44"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                            <button opaque="NO" tag="999" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="PMc-9Y-haA">
+                                <rect key="frame" x="6" y="26" width="32" height="32"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="32" id="Z83-BM-TH0"/>
+                                    <constraint firstAttribute="width" constant="32" id="jGT-Hl-dhj"/>
+                                </constraints>
                                 <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                 <state key="normal" image="fanhui">
                                     <color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@@ -1401,19 +1419,40 @@
                         </subviews>
                         <viewLayoutGuide key="safeArea" id="X4v-Zj-nCH"/>
                         <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                        <constraints>
+                            <constraint firstItem="9dU-L3-mrV" firstAttribute="top" secondItem="X4v-Zj-nCH" secondAttribute="top" id="6zF-Ej-3JG"/>
+                            <constraint firstItem="OFS-Oe-E3p" firstAttribute="centerY" secondItem="9dU-L3-mrV" secondAttribute="centerY" id="Bzr-Ee-Mos"/>
+                            <constraint firstItem="9dU-L3-mrV" firstAttribute="centerX" secondItem="X4v-Zj-nCH" secondAttribute="centerX" id="JUa-BO-ZrK"/>
+                            <constraint firstItem="fIx-Pt-Uyr" firstAttribute="trailing" secondItem="X4v-Zj-nCH" secondAttribute="trailing" id="Jth-YP-0rC"/>
+                            <constraint firstItem="PMc-9Y-haA" firstAttribute="centerY" secondItem="9dU-L3-mrV" secondAttribute="centerY" id="OKO-2R-dKb"/>
+                            <constraint firstItem="fIx-Pt-Uyr" firstAttribute="top" secondItem="9dU-L3-mrV" secondAttribute="bottom" id="QM5-e7-zn5"/>
+                            <constraint firstItem="fb0-v7-JQg" firstAttribute="leading" secondItem="X4v-Zj-nCH" secondAttribute="leading" id="SZj-b3-lcj"/>
+                            <constraint firstItem="fIx-Pt-Uyr" firstAttribute="leading" secondItem="X4v-Zj-nCH" secondAttribute="leading" id="Xig-Ml-G1v"/>
+                            <constraint firstItem="PMc-9Y-haA" firstAttribute="leading" secondItem="X4v-Zj-nCH" secondAttribute="leading" constant="6" id="bUu-Zd-3do"/>
+                            <constraint firstItem="X4v-Zj-nCH" firstAttribute="bottom" secondItem="fb0-v7-JQg" secondAttribute="bottom" id="gRb-CD-Hxa"/>
+                            <constraint firstItem="6ef-Pq-wwt" firstAttribute="trailing" secondItem="X4v-Zj-nCH" secondAttribute="trailing" id="h3U-ey-YGy"/>
+                            <constraint firstItem="6ef-Pq-wwt" firstAttribute="leading" secondItem="X4v-Zj-nCH" secondAttribute="leading" id="hzY-VY-j5l"/>
+                            <constraint firstItem="fb0-v7-JQg" firstAttribute="trailing" secondItem="X4v-Zj-nCH" secondAttribute="trailing" id="oG7-US-BOr"/>
+                            <constraint firstAttribute="bottom" secondItem="6ef-Pq-wwt" secondAttribute="bottom" id="uRP-oh-IOt"/>
+                            <constraint firstItem="X4v-Zj-nCH" firstAttribute="trailing" secondItem="OFS-Oe-E3p" secondAttribute="trailing" constant="6" id="uc9-NC-GjY"/>
+                            <constraint firstItem="6ef-Pq-wwt" firstAttribute="top" secondItem="PeG-ok-jF3" secondAttribute="top" id="vsd-wy-70Z"/>
+                            <constraint firstItem="fb0-v7-JQg" firstAttribute="top" secondItem="fIx-Pt-Uyr" secondAttribute="bottom" id="zfW-kq-9tt"/>
+                        </constraints>
                     </view>
                     <connections>
                         <outlet property="_tableView" destination="fIx-Pt-Uyr" id="nJ4-KD-jac"/>
+                        <outlet property="bottomViewHeight" destination="VXp-uj-aRX" id="lGg-Wv-xvO"/>
                         <outlet property="bottonView" destination="fb0-v7-JQg" id="qkC-uI-M4z"/>
                         <outlet property="fasngBt" destination="fqm-Wo-Kyd" id="LZe-6M-tg0"/>
                         <outlet property="gengduoBt" destination="CBU-HY-KvD" id="Kg2-rg-mTT"/>
+                        <outlet property="inputViewBottom" destination="gRb-CD-Hxa" id="20u-pH-PQU"/>
                         <outlet property="titlelb" destination="9dU-L3-mrV" id="ax9-ZH-PVC"/>
                         <outlet property="yuyinctr" destination="MD5-Ca-QNt" id="QLW-d4-MDn"/>
                     </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="Brr-p8-4s0" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="2756.4885496183206" y="-35.211267605633807"/>
+            <point key="canvasLocation" x="2756" y="-35.532233883058474"/>
         </scene>
     </scenes>
     <resources>

+ 41 - 46
AIIM/Controller/chat/ChatController.m

@@ -57,6 +57,8 @@ static const CGFloat kQuoteViewHeight = 46.0f;
 @property (weak, nonatomic) IBOutlet UIButton *yuyinctr;
 @property (weak, nonatomic) IBOutlet UIButton *fasngBt;
 @property (weak, nonatomic) IBOutlet UIButton *gengduoBt;
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *inputViewBottom;
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomViewHeight;
 
 @property (nonatomic, strong) HistoryPreloader * preloader;
 
@@ -103,6 +105,9 @@ static const CGFloat kQuoteViewHeight = 46.0f;
 @end
 
 @implementation ChatController
+- (UIStatusBarStyle)preferredStatusBarStyle {
+    return UIStatusBarStyleLightContent;
+}
 
 -(void)viewDidLoad{
     [super viewDidLoad];
@@ -136,6 +141,14 @@ static const CGFloat kQuoteViewHeight = 46.0f;
         [weakself removeAtList:index];
     };
     
+    [_inputView mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.height.mas_equalTo(40);
+        make.left.equalTo(self.yuyinctr.mas_right).mas_offset(10);
+        make.right.equalTo(self.gengduoBt.mas_left).mas_offset(-10);
+        make.bottom.mas_offset(-10);
+        make.top.mas_offset(10);
+    }];
+    
     
     //录音按钮
     _AVRecordBt = [[UIButton alloc] initWithFrame:CGRectMake(54, 10, self.view.frame.size.width - 180, 40)];
@@ -954,36 +967,19 @@ static const CGFloat kQuoteViewHeight = 46.0f;
 
 #pragma mark UITextViewDelegate
 - (void)textViewDidChange:(UITextView *)textView {
-    NSLog(@"textViewDidChange---");
-    CGRect newFrame = textView.frame;
-    CGSize newSize = [textView sizeThatFits:CGSizeMake(self.view.frame.size.width - 180, MAXFLOAT)];
-    newSize.width=self.view.frame.size.width - 180;
-    if(newSize.height>160){
+    
+    CGFloat maxHeight = 160;
+    CGFloat maxWidth = self.view.frame.size.width - 190;
+    CGSize newSize = [textView sizeThatFits:CGSizeMake(maxWidth, MAXFLOAT)];
+    if(newSize.height>maxHeight){
         _inputView.scrollEnabled = YES; // 允许滚动,出现滚动条
     }
     else{
         _inputView.scrollEnabled = NO; // 禁止滚动,使内容自适应高度
+        [self movetoBotton];
     }
-    
-    if(newSize.height<41){
-        newSize.height=40;
-    }
-    if(newSize.height>160){
-        newSize.height=160;
-    }
-    
-    CGRect viewFrame = _bottonView.frame;
-    viewFrame.size.height = 62+(self.isQuoteMessage?kQuoteViewHeight:0)+newSize.height-40;
-    viewFrame.origin.y =self.view.frame.size.height-_keyboardHeight-viewFrame.size.height;
-    _bottonView.frame = viewFrame;
-    CGRect tframe = self._tableView.frame;
-    tframe.size.height = viewFrame.origin.y-tframe.origin.y;
-    self._tableView.frame = tframe;
-    [self movetoBotton];
-    newFrame.size = newSize;
-    NSLog(@"newFrame:%f",newFrame.size.height);
-    textView.frame = newFrame;
-    
+    CGFloat height = MAX(40, MIN(maxHeight, newSize.height));
+    self.bottomViewHeight.constant = height+20;
 }
 
 
@@ -1037,7 +1033,7 @@ static const CGFloat kQuoteViewHeight = 46.0f;
 - (void)keyboardWillShow:(NSNotification *)notification {
     // 获取键盘的动画持续时间和动画曲线
     NSDictionary *userInfo = [notification userInfo];
-//    double duration = [[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue];
+    double duration = [[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue];
 //    UIViewAnimationCurve curve = [[userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] integerValue];
 //    
     // 获取键盘的高度
@@ -1046,16 +1042,21 @@ static const CGFloat kQuoteViewHeight = 46.0f;
     NSLog(@"_keyboardHeight:%f",_keyboardHeight);
     // 根据需要调整视图大小或位置(例如,移动某个视图)
     // 示例:将一个视图向下移动以适应键盘高度
-    CGRect viewFrame = _bottonView.frame;
-    viewFrame.origin.y = self.view.frame.size.height-_keyboardHeight-viewFrame.size.height;
-    _bottonView.frame = viewFrame;
-    CGRect tframe = self._tableView.frame;
-    tframe.size.height = viewFrame.origin.y-tframe.origin.y;
-    self._tableView.frame = tframe;
-    [self movetoBotton];
+
     _gengduoBt.alpha = 1;
     _fasngBt.alpha = 1;
     _keybarShow=true;
+    [UIView animateWithDuration:duration
+                          delay:0
+                        options:UIViewAnimationOptionCurveEaseInOut
+                     animations:^{
+        self.inputViewBottom.constant = self.keyboardHeight;
+        [self.view setNeedsLayout];
+        [self.view layoutIfNeeded];
+    } completion:^(BOOL finished) {
+        [self movetoBotton];
+    }];
+    
 }
  
 - (void)keyboardWillHide:(NSNotification *)notification {
@@ -1064,22 +1065,17 @@ static const CGFloat kQuoteViewHeight = 46.0f;
     double duration = [[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue];
     UIViewAnimationCurve curve = [[userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] integerValue];
     
-    // 恢复视图原始位置或大小
-    CGRect viewFrame = self.bottonView.frame;
-    //viewFrame.size.height =62;
-    viewFrame.origin.y = self.view.frame.size.height-viewFrame.size.height-34; //这里keyboardHeight需要是从keyboardWillShow中获取的高度值
-    
-    CGRect tframe = self._tableView.frame;
-    tframe.size.height = viewFrame.origin.y-tframe.origin.y;
-    self._tableView.frame = tframe;
-    [self movetoBotton];
     NSLog(@"_keyboardHeight:%f",_keyboardHeight);
     [UIView animateWithDuration:duration
                          delay:0.0
                        options:(curve << 16)
                     animations:^{
-                        self.bottonView.frame = viewFrame;
-                    } completion:nil];
+        self.inputViewBottom.constant = 0;
+        [self.view setNeedsLayout];
+        [self.view layoutIfNeeded];
+    } completion:^(BOOL finished) {
+        [self movetoBotton];
+    }];
     if(_inputView.text.length>0){
         _gengduoBt.alpha = 1;
         _fasngBt.alpha = 1;
@@ -1318,8 +1314,7 @@ static const CGFloat kQuoteViewHeight = 46.0f;
     CGRect popfram = CGRectMake(0,self.view.frame.size.height, self.view.frame.size.width, 250);
     _popView.frame = popfram;
     _markView.frame=popfram;
-    _markView.backgroundColor = [UIColor lightGrayColor];
-    _markView.alpha=0.7;
+    _markView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
     [self movetoBotton];
 }
 

+ 3 - 3
AIIM/Controller/chat/chetCell/chatpopView.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23727" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina6_12" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23721"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -88,7 +88,7 @@
                 </button>
             </subviews>
             <viewLayoutGuide key="safeArea" id="z4B-XS-7PW"/>
-            <color key="backgroundColor" white="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+            <color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
             <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
             <point key="canvasLocation" x="350.38167938931298" y="177.46478873239437"/>
         </view>