简体   繁体   English

设备上的方向不变

[英]Orientation not changing on device

I have supported both LandscapeLeft and landscapeRight directions 我同时支持LandscapeLeft和landscapeRight方向

-(NSUInteger)supportedInterfaceOrientations
{

     return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationLandscapeRight;
}

But the orientation is not changing for landscapeRight. 但是landscapeRight的方向并没有改变。 I have added observer to detect the orientation change events, those events are being called but the statusBar and navigation bar do not change for landscapeRight mode. 我添加了观察者以检测方向更改事件,这些事件被调用,但是对于landscapeRight模式,statusBar和导航栏不会更改。

Add

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    UIInterfaceOrientationIsLandscape(toInterfaceOrientation);
}

You've got TYPO Instead of 您有TYPO而不是

UIInterfaceOrientationMaskLandscapeRight

you've got 你有

UIInterfaceOrientationLandscapeRight

Check if you have checked it orientation support on your project setting. 检查是否在项目设置中选中了它的方向支持。 设置项目导向支持 .

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

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