2012-02-15 98 views

回答

1

变化

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    // Return YES for supported orientations 
    return (interfaceOrientation == UIInterfaceOrientationPortrait); 
} 

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    // Return YES for supported orientations 
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); 
} 

另外,还要确保在您的项目设置你 '支持的装置定向' 设置为允许景观。

+0

不行!:(本当我只使用横向方向时,Xcode输入此代码 – GeraldoBastos 2012-02-18 18:10:42

+0

@GeraldoBastos您是否在设置中启用了横向视图?以上任何情况下都会触发设备旋转到任何位置e xcept肖像颠倒。 – Bot 2012-02-20 16:10:50

+0

是的!但不行。 – GeraldoBastos 2012-03-30 16:43:21

相关问题