我正在开发的iPhone应用程序中有一个奇怪的问题。我希望我的应用程序仅支持纵向模式,但由于某种原因,我无法执行此操作(设备&模拟器)。如何仅在iPhone应用程序上支持肖像模式
只支持纵向模式我做了如下:
- 在上Xcode中TARGET摘要部分,我只选择了肖像。
- 我所有的ViewControllers实现
shouldAutorotateToInterfaceOrientation
但正如我所说,它不会工作,而奇怪的结果是,应用程序的支持ALL的方向(纵向,上下颠倒,景观左,右景观) 。
任何想法?
这个我如何实现shouldAutorotateToInterfaceOrientation
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
NSLog(@"Checking orientation %d", interfaceOrientation);
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
我注意到刚才,当我旋转手机,我得到这个消息:
“两级旋转动画被弃用此应用程序应该 使用更流畅的单段动画。“
这是什么意思?
从每个地方返回NO。 – Nilesh 2012-04-05 18:13:17
试试我的答案。也许它会有所帮助。 – 2012-04-06 10:45:15
试着在你的'shouldAutorotateToInterfaceOrientation'方法中添加'NSLog(@“检查方向%d”,interfaceOrientation);''。当您旋转模拟器或您的设备时是否调用了它们中的任何一个? – Dondragmer 2012-04-07 22:48:42