@@ -809,13 +809,7 @@ - (void)didTapScrollView:(UIGestureRecognizer *)gesture
809
809
810
810
- (void )didPanTextView : (id )sender
811
811
{
812
- // Skips if the text view is already first responder
813
- if ([self .textView isFirstResponder ]) {
814
- return ;
815
- }
816
-
817
- // Become first responder and enable keyboard
818
- [self .textView becomeFirstResponder ];
812
+ [self presentKeyboard: YES ];
819
813
}
820
814
821
815
- (void )editText : (NSString *)text
@@ -1432,16 +1426,21 @@ - (void)showAutoCompletionView:(BOOL)show
1432
1426
viewHeight = [self maximumHeightForAutoCompletionView ];
1433
1427
}
1434
1428
1435
- CGFloat tableHeight = self.scrollViewHC .constant ;
1429
+ CGFloat tableHeight = self.scrollViewHC .constant + self. autoCompletionViewHC . constant ;
1436
1430
1437
- // If the the view controller extends it layout beneath it navigation bar and/or status bar, we then reduce it from the table view height
1438
- if (self.edgesForExtendedLayout == UIRectEdgeAll || self.edgesForExtendedLayout == UIRectEdgeTop) {
1439
- tableHeight -= CGRectGetHeight ([UIApplication sharedApplication ].statusBarFrame );
1440
- tableHeight -= self.navigationController .navigationBar .frame .size .height ;
1431
+ // Only when the view extends its layout beyond it top edge
1432
+ if ((self.edgesForExtendedLayout & UIRectEdgeTop) > 0 ) {
1433
+
1434
+ // On iOS7, the status bar isn't automatically hidden on landscape orientation
1435
+ if (UI_IS_IPHONE && UI_IS_LANDSCAPE && !UI_IS_IOS8_AND_HIGHER) {
1436
+ tableHeight -= CGRectGetHeight ([UIApplication sharedApplication ].statusBarFrame );
1437
+ }
1438
+
1439
+ tableHeight -= CGRectGetHeight (self.navigationController .navigationBar .frame );
1441
1440
}
1442
1441
1443
1442
// On iPhone, the autocompletion view can't extend beyond the table view height
1444
- if (viewHeight > tableHeight) {
1443
+ if (UI_IS_IPHONE && viewHeight > tableHeight) {
1445
1444
viewHeight = tableHeight;
1446
1445
}
1447
1446
@@ -1691,7 +1690,7 @@ - (void)setupViewConstraints
1691
1690
@" textInputbar" : self.textInputbar ,
1692
1691
};
1693
1692
1694
- [self .view addConstraints: [NSLayoutConstraint constraintsWithVisualFormat: @" V:|[scrollView(0@750)][autoCompletionView(0)][typingIndicatorView(0)]-0@999-[textInputbar(>=0)]|" options: 0 metrics: nil views: views]];
1693
+ [self .view addConstraints: [NSLayoutConstraint constraintsWithVisualFormat: @" V:|[scrollView(0@750)][autoCompletionView(0@750 )][typingIndicatorView(0)]-0@999-[textInputbar(>=0)]|" options: 0 metrics: nil views: views]];
1695
1694
[self .view addConstraints: [NSLayoutConstraint constraintsWithVisualFormat: @" H:|[scrollView]|" options: 0 metrics: nil views: views]];
1696
1695
[self .view addConstraints: [NSLayoutConstraint constraintsWithVisualFormat: @" H:|[autoCompletionView]|" options: 0 metrics: nil views: views]];
1697
1696
[self .view addConstraints: [NSLayoutConstraint constraintsWithVisualFormat: @" H:|[typingIndicatorView]|" options: 0 metrics: nil views: views]];
0 commit comments