2011-10-30 36 views
0

我有一个包含一堆UILabels的视图。截至目前视图只能配置为当设备的方向是纵向时工作,但是我想这样做是为了当设备旋转时,一个特定的UILabel的位置被改变并且文本尺寸被放大。当设备的方向恢复为人像时,我希望它恢复到原始状态。UIView旋转文本操作

我应该怎么做呢?

回答

2

在您的ViewController中实现此方法并相应地进行更改。

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{ 

     if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation)) { 
     // do something in landscape orientation 
     } else { 
     // do something in portrait orientation 
     } 

    }