Iphone 根UIViewController方向横向,在子视图中

Iphone 根UIViewController方向横向,在子视图中,iphone,uiviewcontroller,orientation,Iphone,Uiviewcontroller,Orientation,我正在做一个应用程序,这将是景观只。因此,我的根UIViewController设置为横向(我所有的xib文件都是横向的) 当我尝试触摸其中一个子视图中的按钮时,它不会收到触摸。如果我移除上面显示的覆盖,按钮会得到触碰,但子视图以纵向显示 // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UI

我正在做一个应用程序,这将是景观只。因此,我的根UIViewController设置为横向(我所有的xib文件都是横向的)

当我尝试触摸其中一个子视图中的按钮时,它不会收到触摸。如果我移除上面显示的覆盖,按钮会得到触碰,但子视图以纵向显示

// Override to allow orientations other than the default portrait orientation.
 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
我应该如何解决这个问题

谢谢并致以最良好的问候


David

除此之外,您还必须在info.plist文件中设置支持的方向

它位于“支持的界面方向”下,键为“UI支持的界面方向”。删除列表中的纵向方向