简体   繁体   English

iPhone / iPad:何时在设备旋转时更改背景

[英]iPhone/iPad: When to change background on rotate of device

At what point in the rotation of a device should I replace the image that forms the background. 我应该在设备旋转的什么时候替换形成背景的图像。 There are 2 images, one for Landscape, one for Portrait. 有2张图像,一张用于风景,一张用于肖像。

Currently I use the WillRotate event, but it's 'choppy' in performance and I get warnings about not to do this in a two stage rotation. 当前,我使用WillRotate事件,但它的性能“起伏不定”,并且我收到有关在两阶段轮换中不执行此操作的警告。

I use either - 我用-

1. -(void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration 1 -(void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration

Sent to the view controller before performing a one-step user interface rotation. 在执行单步用户界面旋转之前,已发送给视图控制器。

or 要么

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation

Sent to the view controller after the user interface rotates. 用户界面旋转后发送到视图控制器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM