【发布时间】:2010-11-02 01:59:49
【问题描述】:
我知道我可以在 shouldAutorotateToInterfaceOrientation 中返回 YES 以支持横向模式。但是我想显示一个新视图,当用户将设备变为横向模式时,我该怎么做?谢谢你。
【问题讨论】:
标签: iphone objective-c ios4
我知道我可以在 shouldAutorotateToInterfaceOrientation 中返回 YES 以支持横向模式。但是我想显示一个新视图,当用户将设备变为横向模式时,我该怎么做?谢谢你。
【问题讨论】:
标签: iphone objective-c ios4
关注本次活动UIDeviceOrientationDidChangeNotification
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(orientationDidChange:)
name:UIDeviceOrientationDidChangeNotification object:nil];
【讨论】:
对于这种情况,一个有用的技术是,呈现一个新的模态视图控制器,并从当前视图“淡出”过渡。正如 Aaron 之前提到的,您可以对 UIDeviceOrientationDidChangeNotification 做出反应。
【讨论】:
[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];
【讨论】: