在应用开始时强制横向模式,但允许稍后更改方向 [英] Force landscape mode at the beginning of app, but allow later changes in orientation
本文介绍了在应用开始时强制横向模式,但允许稍后更改方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我计划允许用户旋转设备但是在启动期间,我希望应用程序从横向模式启动。我可以知道我该怎么办?
I am planning to allow user to rotate the devices however during launch, i want the app start from landscape mode. May i know how can i do that?
这是我的代码现在的方向
Here is my code now for the orientation
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
} else {
return YES;
}
}
推荐答案
你需要检查状态栏的方向。
You need to check the orientation of the status bar.
请检查以下链接: -
Please check the following links :-
这篇关于在应用开始时强制横向模式,但允许稍后更改方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文