我应该在设备旋转的哪个点替换形成背景的图像。有 2 张图像,一张为风景,一张为肖像。
目前,我使用 WillRotate 事件,但它的性能“不稳定”,并且我收到关于不要在两阶段轮换中执行此操作的警告。
最佳答案
我使用其中一个 -
1.
-(void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation 持续时间:(NSTimeInterval)duration
在执行一步用户界面旋转之前发送到 View Controller 。
或
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
用户界面旋转后发送到 View Controller 。
关于iPhone/iPad : When to change background on rotate of device,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7504447/