不同的初始界面方向iPhone和iPad通用应用程序 [英] Different Initial interface orientation iPhone and iPad universal application
本文介绍了不同的初始界面方向iPhone和iPad通用应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想要的是iPhone的纵向和iPad应用的横向。
我的应用针对的是> 申请
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return(interfaceOrientation == UIInterfaceOrientationLandscapeRight ||
interfaceOrientation == UIInte rfaceOrientationLandscapeLeft);
}
What I want is Portrait orientation for iPhone and Landscape orientation for iPad app.
My app is targeted for > ios5
I searched on web about this but got different answers but not the exact one.
解决方案
So here is what I did
For iPhone
and for iPad
And for iPad controllers I added below code, this is not necessary for ios6 applications
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight ||
interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
这篇关于不同的初始界面方向iPhone和iPad通用应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文