Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIView Clipped By Statusbar until Autorotate

Ive created a multiview application that uses multiple controllers to display and control views. The problem Im having is, when the simulator initially loads the view the header is partially covered by the bar at top of screen and the tool bar at the base is not touching the base of the screen. I used the Interface builder size attributes to control the view when the iphone rotates and it works perfectly. All smaps into place perfectly both in landscape and portrait mode AFTER a rotation but the problem is with the initial load before a rotation occurs. Your thoughts a much appreciated. Tony

like image 967
TonyNeallon Avatar asked Jan 28 '09 10:01

TonyNeallon


1 Answers

I grappled with this issue for days and days--no amount of fiddling in IB worked.

Ultimately I got it to work by adding this line:

mainViewController.view.frame = window.screen.applicationFrame;

to the application:didFinishLaunchingWithOptions: method. (Where mainViewController is the primary UIViewController).

like image 58
jkomoros Avatar answered Oct 04 '22 21:10

jkomoros