【发布时间】:2010-02-20 15:59:18
【问题描述】:
您好,我有这段代码...
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return YES;
}
和
- (void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if(UIInterfaceOrientationIsPortrait(interfaceOrientation)){
// WTF, this runs when I change to Landscape
} else {
// this runs when I change to Portrait??? shouldn't it be the contrary?
}
}
如您所见,代码是反向运行的,我的意思是,当我将设备更改为纵向时应该运行的部分,代码的横向部分运行,反之亦然。
当我转动设备时,self.view 会旋转。
这个 UIInterfaceOrientationIsPortrait 是在测试界面在旋转之前的状态还是我遗漏了什么?
感谢您的帮助。
【问题讨论】:
标签: iphone iphone-sdk-3.0 ipad