ipad all views start in portrait mode even when app loads in landscape
I have a nicely complex nested set of Viewcontrollers, one of them (about 5 deep) has custom made panel's that are generated on startup. I have code that detects the rotation of the device and re-arranges the panels accordingly so there's 3 panels wide on portrait and 4 panels wide on landscape. I have done this by using a width component rather than detecting the orientation.
The method that re-positions the panels (uiscrollview) works flawlessly on rotation and even on start up but only gets the portrait height on startup.
No matter how i retrieve the width attribute, its returning the portrait width item, i have tried the following:
float frameWidth = mainPanel.frame.size.width;
float frameWidth = self.view.frame.size.width;
float frameWidth = [[[UIApplication sharedApplication] keyWindow] frame].size.width;
and sti开发者_开发问答ll no luck!
(mainpanel is a uiscrollview that is set to autostretch to the nib's size)
Is this a better way to do this?
精彩评论