无论方向如何,主屏幕和 self.view 始终保持相同的宽度和高度尺寸(即使 self.view 确实正确调整大小以适应当前设备方向)背后的逻辑是什么,而子视图当设备方向改变时,self.view 返回修改后的宽度和高度尺寸?
NSLog(@"screen bounds w: %f, h: %f", [[UIScreen mainScreen] bounds].size.width,[[UIScreen mainScreen] bounds].size.height );
NSLog(@"self.view frame w: %f, h: %f", self.view.frame.size.width, self.view.frame.size.height );
NSLog(@"myView frame w: %f, h: %f", _myView.frame.size.width, _myView.frame.size.height );
日志输出画像
2012-11-05 16:15:11.152 test[2807:11303] screen bounds w: 320.000000, h: 480.000000
2012-11-05 16:15:11.153 test[2807:11303] self.view frame w: 320.000000, h: 460.000000
2012-11-05 16:15:11.153 test[2807:11303] myView frame w: 320.000000, h: 460.000000
日志输出景观
2012-11-05 16:14:38.800 test[2807:11303] screen bounds w: 320.000000, h: 480.000000
2012-11-05 16:14:38.801 test[2807:11303] self.view frame w: 300.000000, h: 480.000000
2012-11-05 16:14:38.801 test[2807:11303] myView frame w: 480.000000, h: 300.000000