我有源允许旋转interfaceOrientation。 (在viewDidLoad中)
CGPoint point;
NSInteger itemCount;
if (self.interfaceOrientation == UIInterfaceOrientationPortrait || self.interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)
point.x = (self.view.frame.size.width - (100 * itemCount)) / 2
else
...
尽管在UIInterfaceOrientationLandscapeLeft
模式下运行模拟器,但我有{8}像素的self.view.frame.size.width
(在iPad上),所以我没有适当的point.x值。
如何在旋转时访问self.view.frame
?