iphone - UINavigationController.view.frame returns portrait CGRect even in landscape orientation. How to fix this? -
i've uinavigationcontroller , started in landscape mode right beginning. ipad app made support landscape interface orientations. however, whenever call navigationcontroller.view.frame, returned cgrect portrait.
how can cgrect showing landscape values in frame ? (0,0,1024,768) instead of (0,0,768,1024)
use bounds property instead.
it looks navigation controllers rootviewcontroller of window. window manages autorotation rotating root view controller. rotation done applying transfrom, navcontroller.view should print non-identity transform too.
frameouter rectangle in parent coordinates , since coordinate system of window didn't change, frame same in orientations. suitable used sibling or parent views.boundsinner rectangle. have correct dimensions in case , suitable use subviews make calculations
usually frame , bounds have same dimensions when transform cgaffinetransformidentity. once transfrom changing, need know when use frame , when bounds. can find many resources describing difference between frame , bounds on internet.
Comments
Post a Comment