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.

  • frame outer rectangle in parent coordinates , since coordinate system of window didn't change, frame same in orientations. suitable used sibling or parent views.
  • bounds inner 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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -