修改或添加info.plist<key>UIInterfaceOrientation</key>
<string>UIInterfaceOrientationLandscapeRight</string>
if(interfaceOrientation == UIInterfaceOrientationPortrait||interfaceOrientation==UIInterfaceOrientationPortraitUpsideDown){
[backimage setImage:[UIImage imageNamed:@"Shu_Background.png"]];
SetFrame 320,480
}else
{
[backimage setImage:[UIImage imageNamed:@"Heng_Background.png"]];
SetFrame 480,320
}
return ((interfaceOrientation == UIDeviceOrientationLandscapeLeft)||(interfaceOrientation == UIDeviceOrientationLandscapeRight)||(interfaceOrientation == UIDeviceOrientationPortraitUpsideDown)||(interfaceOrientation == UIDeviceOrientationPortrait));
本文介绍如何通过修改iOS应用的info.plist文件来控制应用的屏幕显示方向,并提供了一个具体的实现示例,包括针对不同方向设置不同的背景图片及帧尺寸。

4964

被折叠的 条评论
为什么被折叠?



