ios - Unexpected Behaviour of UIViewController autoresizingMask = UIViewAutoresizingFlexibleHeight -


i have ios app built using phonegap/cordova (3.0), , i'm trying updated work correctly ios 7 , xcode 5, particularly new-style status bar.

i don't have lot of experience native ios programming or objective-c, i'm pretty figuring things out go along, , first post on stackoverflow, please forgive me if wrong.

the issue i've run this:

phonegap includes inappbrowser plugin, separate webview displayed on top of app (which app uses twitter login, if there no native twitter accounts set up). doesn't seem have been updated @ yet ios 7, status bar appears on top of whatever web page loaded in plugin. i've been trying deal resizing webview it's height 20px lower, leaving gap status bar.

this main code i've been modifying try achieve desired result:

- (void)createviews {  cgrect webviewbounds = self.view.frame;  webviewbounds.origin.y += 20; //added me webviewbounds.size.height -= 20; //added me [self.view setframe: webviewbounds]; //added me  webviewbounds.size.height -= footer_height;  self.webview = [[uiwebview alloc] initwithframe:webviewbounds]; self.webview.autoresizingmask = (uiviewautoresizingflexiblewidth | uiviewautoresizingflexibleheight);  [self.view addsubview:self.webview]; [self.view sendsubviewtoback:self.webview]; 

(the webview resized elsewhere in plugin, based on self.view.frame , subtracting bit height allow inappbrowser toolbar buttons @ bottom of screen)

so sizes , positions self.view.frame fit underneath status bar, , further webview sizing/resizing based on size , position. works perfectly, except height of webview ends being big (the bottom of webpage ends underneath toolbar). made absolutely no difference how subtracted self.view.frame.size.height. thing made work expected commenting out autoresizingmask on webview (but of course caused other issues)

after lot of experimentation (and pulling large quantity of hair out), i've narrowed down. seems when webview auto-resized, it's being treated if frame.origin.y set 0 (it gets resized fit correctly there), though it's 20. when set 0, resizes correctly, when set other value ends being high amount, though value of height has taken account.

so, can deal modifying every webview height change subtract origin.y value (20px), , appears work correctly, surely (and looking @ actual numbers seems confirm) subtracting height twice. make sense? missing here?


Comments

Popular posts from this blog

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c - Avoiding Extra Malloc in Linked List (node->next = NULL) -