1
我正在导航控制器在我的故事板中,但我的应用程序始终是纵向格式,当我将模拟器放在横向模式中时。为什么? =(导航控制器与故事板[iPhone]的景观
我正在导航控制器在我的故事板中,但我的应用程序始终是纵向格式,当我将模拟器放在横向模式中时。为什么? =(导航控制器与故事板[iPhone]的景观
变化
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
要
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
另外,还要确保在您的项目设置你 '支持的装置定向' 设置为允许景观。
不行!:(本当我只使用横向方向时,Xcode输入此代码 – GeraldoBastos 2012-02-18 18:10:42
@GeraldoBastos您是否在设置中启用了横向视图?以上任何情况下都会触发设备旋转到任何位置e xcept肖像颠倒。 – Bot 2012-02-20 16:10:50
是的!但不行。 – GeraldoBastos 2012-03-30 16:43:21