首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Iphone >

IPhone荧屏方向设置

2012-12-15 
IPhone屏幕方向设置新手手机游戏开发,横屏的, 积分墙广告只支持竖屏,需要临时换一个方向,怎么处理?[最优解

IPhone屏幕方向设置
新手手机游戏开发,横屏的, 积分墙广告只支持竖屏,需要临时换一个方向,怎么处理?
[最优解释]
网上的例子,可以参考

http://blog.csdn.net/dongge_111/article/details/7394950

http://www.istar.name/blog/ios-development-rotation
[其他解释]
先试试这个吧,先保证横屏和竖屏都可行。然后在横屏ViewControllers中,添加这个:

-(NSUInteger)supportedInterfaceOrientations{
    return UIInterfaceOrientationMaskLandscape;
}



在竖屏的ViewController中添加:

-(NSUInteger)supportedInterfaceOrientations{
    return UIInterfaceOrientationMaskPortrait;
}

[其他解释]
如果不是ios6版本可以用在AppDelegate,实现积分榜横屏。

// 需要支持横向.根据需要自定义
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}



#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_6_0
- (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
{
    return UIInterfaceOrientationMaskAllButUpsideDown; //要是这里出现问题可能是xcode版本,xcode版本要4.5+
}
#endif



设置为横屏模式


[其他解释]
http://blog.csdn.net/xuanwenchao/article/details/7979744

第5个
[其他解释]
http://blog.csdn.net/duxinfeng2010/article/details/8024379
[其他解释]
这要看你的游戏具体实现的代码啊。你把代码贴上来看一下
[其他解释]
..这个没遇到过

热点排行