【发布时间】:2012-05-04 18:45:30
【问题描述】:
我怎样才能让我的应用程序始终只处于纵向模式。如果我旋转 iPhone,它不应该以横向模式显示应用程序。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation != UIInterfaceOrientationPortrait);
return YES;
}
当我旋转 iPhone 应用程序以横向模式显示此编码之后。我怎样才能让应用程序一直处于纵向模式。
【问题讨论】:
-
下面的答案很好,为了将来参考,“!=”表示不等于,因此您发布的代码告诉您的应用返回除纵向以外的任何方向。
标签: iphone objective-c