You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2013/09/25 11:05:39 UTC

ios commit: Fixed scrollView frame problem (CB-3020)

Updated Branches:
  refs/heads/CB-3020 639f9eb9c -> 6673f6263


Fixed scrollView frame problem (CB-3020)


Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/6673f626
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/6673f626
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/6673f626

Branch: refs/heads/CB-3020
Commit: 6673f62634a6861a27d3094008107675f990d2e8
Parents: 639f9eb
Author: Shazron Abdullah <sh...@apache.org>
Authored: Wed Sep 25 02:05:30 2013 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Wed Sep 25 02:05:30 2013 -0700

----------------------------------------------------------------------
 CordovaLib/Classes/CDVViewController.m | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/6673f626/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m
index 3ae5fc7..e81f5f1 100644
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@ -123,7 +123,7 @@
 }
 
 CGFloat gAccessoryBarHeight = 0.0;
-- (void)hideKeyboardFormAccessoryBar:(NSNotification*)notif
+- (void)hideKeyboardFormAccessoryBarStart:(NSNotification*)notif
 {
     NSArray* windows = [[UIApplication sharedApplication] windows];
 
@@ -158,6 +158,12 @@ CGFloat gAccessoryBarHeight = 0.0;
     }
 }
 
+- (void)hideKeyboardFormAccessoryBarEnd:(NSNotification*)notif
+{
+    // restore the scrollview frame
+    self.webView.scrollView.frame = self.webView.frame;
+}
+
 - (void)keyboardWillShow:(NSNotification*)notif
 {
     if (![@"true" isEqualToString :[self settingForKey:@"KeyboardShrinksView"]]) {
@@ -348,7 +354,13 @@ CGFloat gAccessoryBarHeight = 0.0;
                                                            queue:[NSOperationQueue mainQueue]
                                                       usingBlock:^(NSNotification* notification) {
             // we can't hide it here because the accessory bar hasn't been created yet, so we delay on the queue
-            [weakSelf performSelector:@selector(hideKeyboardFormAccessoryBar:) withObject:notification afterDelay:0];
+            [weakSelf performSelector:@selector(hideKeyboardFormAccessoryBarStart:) withObject:notification afterDelay:0];
+        }];
+        [[NSNotificationCenter defaultCenter] addObserverForName:UIKeyboardWillHideNotification
+                                                          object:nil
+                                                           queue:[NSOperationQueue mainQueue]
+                                                      usingBlock:^(NSNotification* notification) {
+                                                          [weakSelf hideKeyboardFormAccessoryBarEnd:notification];
         }];
     }