Iphone 设备上的方向不改变
我支持景观左方向和景观右方向Iphone 设备上的方向不改变,iphone,xcode,uiinterfaceorientation,orientation-changes,Iphone,Xcode,Uiinterfaceorientation,Orientation Changes,我支持景观左方向和景观右方向 -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationLandscapeRight; } 但景观设计的方向并没有改变。我添加了observer来检测方向更改事件,这些事件正在被调用,但对于landsca
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationLandscapeRight;
}
但景观设计的方向并没有改变。我添加了observer来检测方向更改事件,这些事件正在被调用,但对于landscapeRight模式,状态栏和导航栏不会更改。检查您是否已在项目设置上检查it方向支持。添加
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
UIInterfaceOrientationIsLandscape(toInterfaceOrientation);
}
你有打字错误
而不是
UIInterfaceOrientationMaskLandscapeRight
你有
UIInterfaceOrientationLandscapeRight
它是在项目设置中检查的,但不起作用:(您正在测试的iOS版本是什么?非常感谢Andrei,只是这是问题所在。