Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIView frame changes from viewWillAppear: to viewDidAppear:

I'm initializing a UIView with the frame: CGRectMake(0, 0, 1024, 768). Everything seems right, until its superview enters the viewDidAppear: method. The frame changes to 768, 1024. The problem only occurs when the Status bar is initially hidden property is set to YES. The frame does not change if the status bar is shown.

I have checked the UIInterfaceOrientation in viewWillAppear: and viewDidAppear: and it does not change between the two methods.

Why does the frame's height and width swap when the status bar is hidden?

like image 817
ThomasCle Avatar asked Jul 02 '12 12:07

ThomasCle


1 Answers

In app delegate set wantsFullScreenLayout property of viewController to YES.

like image 68
rishi Avatar answered Oct 16 '22 10:10

rishi