I've got a simple app with two UIViews, the larger one is created through interface builder, the smaller one programmatically:

Portrait

In Portrait when running on the retina ipad simulator the larger view is taller than the screen. On non-retina ipad it's the correct height. Same on 4 inch iPhone and 3.5 inch iPhone.

However when you rotate the device:

Landscapre

The larger view no longer fills the screen.

I've been iterating on settings the sizes programmatically for so long I don't know which way it up. This is a very simple version of what I've been trying:

  -(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInt
                               duration:(NSTimeInterval)duration {

    CGRect screenBounds = [[UIScreen mainScreen] bounds];
    self.webView.frame  = screenBounds;
}

I've had additional math to cut the height of the larger view by the height of the smaller view, which works -- but I still can't resolve the lack of filling out the screen or the fact that on the retina ipad the height of the larger control is too tall.

Am I getting the size from the wrong place? Is there a way to programmatically tell how tall the statusbar is? Or do I just need to hard code in the 20 pixels?

Related posts

Recent Viewed