iPhone如何改变风景为人像? [英] iphone how to change landscape to portrait?
本文介绍了iPhone如何改变风景为人像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在iPhone中开发了一个简单的游戏.整个游戏处于横向模式,但记分板页面仅支持纵向模式.我在这里检查了问题,我只发现将人像变成风景模式,但是我需要相反的答案.有人可以帮我吗?
I develop a simple game in iPhone. The whole game is in landscape mode, but the scoreboard page only support portrait mode. I have checked the questions here, I only find turn portrait into landscape mode, but I need the opposite answer. Could anyone help me?
推荐答案
这很简单.首先,确保目标摘要中同时支持纵向和横向.然后:
It's very simple. First, make sure both portrait and landscape orientations are supported in the target summary. Then:
在景观ViewController中,添加以下内容:
In the landscape ViewControllers, add this:
-(NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;
}
在肖像ViewController中,添加以下内容:
And in the portrait ViewController, add this:
-(NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait;
}
这篇关于iPhone如何改变风景为人像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文