[ 
https://issues.apache.org/jira/browse/CB-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13430404#comment-13430404
 ] 

Kevin Hawkins commented on CB-1204:
-----------------------------------

Thanks Shazron.  Yeah, I'll take a look.  Sleeping on it, I think I actually 
disagree with my stated approach of putting this in the parent view controller 
(CDVViewController).  In the interests of moving towards Cordova modularity, 
the "framework" VC shouldn't be deciding the absolute sizing of its views; the 
inheriting view controller is probably a better place for that.

At any rate, I'll put together a pull request with the proposed changes, after 
going through the workflow details, and we can hash it out there.

                
> CDVViewController-loaded view doesn't respect applicationFrame
> --------------------------------------------------------------
>
>                 Key: CB-1204
>                 URL: https://issues.apache.org/jira/browse/CB-1204
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.8.1, 1.9.0, 2.0.0
>         Environment: Mac OS X Lion, Xcode 4.4, iOS SDK 5.1.
>            Reporter: Kevin Hawkins
>            Assignee: Shazron Abdullah
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> If you take the Cordova template app and, instead of using:
> [self.window addSubview:self.viewController.view];
> to display the view in the AppDelegate, you use the more recommended (for iOS 
> >= 4.0) method of:
> self.window.rootViewController = self.viewController;
> to display the view, there is a positioning difference for the web view, due 
> to the fact that, in the latter case, self.viewController.view's frame is not 
> being set at the appropriate time.  This sets the view's frame to the entire 
> height and width of the device.  I.e. it doesn't account for the space taken 
> up by the status bar.  This can be easily verified by making an index.html 
> page with an h1 header at the top, and toggling which code line you use to 
> display the view, from the given lines above.
> The solution to this is to set the view's frame in viewWillAppear in 
> CDVViewController:
> - (void)viewWillAppear:(BOOL)animated
> {
>     self.view.frame = [[UIScreen mainScreen] applicationFrame];
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to