在Xcode中,我尝试设计一个仅支持横屏的用户界面。我将UIViewController和UIView控件都设置为横向模式。但是当我在UIView上放置控件(如按钮、图片)时,在程序运行时,只有位于左上角的控件响应。似乎程序仍在以纵向模式运行。
-(BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation) interfaceOrientation
。- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight));
}