這個事實背後的邏輯是什麼主屏幕和self.view始終保持相同的寬度和高度尺寸,而不管方向如何(即使self.view的尺寸正確,以適應當前的設備方向),而sub - 當設備方向改變時,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