ios - Get the CGRect frame of the inner contentView of a UINavigationController during or before loadView -


apple's docs say:

note: because amount of space available custom view can vary (depending on size of other navigation views), custom view’s autoresizingmask property should set have flexible width , height. before displaying view, navigation controller automatically positions , sizes fit available space. 

that's great, except ... need know size uinavcontroller use before view added frame, because content i'll displaying different depending on size.

this inside "loadview" method of uiviewcontroller that's being added uinavigationcontroller.

well, technically shouldn't sizing subviews in loadview method. don't use nibs, , in of view controllers loadview small: self.view = [[uiview alloc] init];. then, in viewdidload add subviews self.view. finally, of resizing in viewwillappear, because @ point self.view appropriate size.

if must size views in loadview method, you'll have calculate out dimensions manually...i.e: find out orientation of device (self.interfaceorientation) determine screen size, subtract out whatever other elements think on screen (like navigation bar, etc). method not recommended.


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -