iOS开发(iPad/iPhone)设置app界面 默认横向显示的两种方法
2014-01-16 09:59
966 查看
方法一:
用文本编辑工具 打开工程属性文件,也就是那个 xx-info.plist文件,把下面蓝色的部分复制进去,保存。重新编译下,OK。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIInterfaceOrientation</key>
<string>UIInterfaceOrientationLandscapeRight</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
</array>
</dict>
</plist>
方法二:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
//return (interfaceOrientation == UIInterfaceOrientationPortrait);
//只支持横屏
if(UIInterfaceOrientationIsLandscape(interfaceOrientation))
{
return YES;
}
/*else//只支持竖屏
if(UIInterfaceOrientationIsPortrait(interfaceOrientation))
{
return YES;
}
*/
return NO;
}
用文本编辑工具 打开工程属性文件,也就是那个 xx-info.plist文件,把下面蓝色的部分复制进去,保存。重新编译下,OK。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIInterfaceOrientation</key>
<string>UIInterfaceOrientationLandscapeRight</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
</array>
</dict>
</plist>
方法二:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
//return (interfaceOrientation == UIInterfaceOrientationPortrait);
//只支持横屏
if(UIInterfaceOrientationIsLandscape(interfaceOrientation))
{
return YES;
}
/*else//只支持竖屏
if(UIInterfaceOrientationIsPortrait(interfaceOrientation))
{
return YES;
}
*/
return NO;
}
相关文章推荐
- iOS开发(iPad/iPhone)设置app界面 默认横向显示的两种方法
- iOS开发iPad和iPhone的启动画面设置
- iOS开发-隐藏系统状态栏 让app启动时图片全屏 进入程序后显示状态栏方法。
- iOS开发人员必备App开发工具 ifunbox 支持iPhone, iPad和iPod Touch的文件及应用管理神器 使用实例
- (iPhone/iPad开发)怎样判断ios app 第一次启动
- Android设置Activity(界面)为全屏显示的两种方法 xml和java程序
- HotApp小程序统计开发总结之设置了navigationBarBackgroundColor颜色,android 可以显示,ios不能显示
- iPad和iPhone的app图标尺寸、用途、设置方法
- APP首次启动引导界面和启动界面设置——iOS开发
- web app开发中 iPhone、iPad默认按钮样式问题
- APP首次启动引导界面和启动界面设置——iOS开发
- iOS开发中App启动页和应用缩略图标的两种设置方式
- iOS程序开发对iPhone和iPad兼容性的规划方法
- 标签:ios开发 界面启动 APP下载安装第一次使用一般会显示一个首次启动引导界面然后进入主界面,非首次开启APP也通常会显示一个启动界面然后进入主界面。 1、本例首次启动显示First
- 30个真棒的(免费iPhone,iPad IOS)的GUI 界面设计元素模板 做iphone开发的福音
- iOS:界面适配(一)--Universal通用程序 iPhone、iPad适配(方法)
- 两种方法修改Ubuntu设置为默认文字界面启动
- iOS开发之在客服开发之QQ, 在APP中打开指定qq聊天界面的方法