表视图控制器中的方向?

时间:2012-02-17 18:35:56

标签: iphone objective-c ios xcode ios-simulator

我的项目中有一个Table View Controller(root)和5个View Controller。视图控制器仅转向横向视图(如我所愿),但不转向表视图控制器(仅在纵向视图中)。在支持的设备方向中,我删除了纵向和上下颠倒,我在每个类中都写了:

  • (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return((interfaceOrientation == UIInterfaceOrientationLandscapeLeft)||(interfaceOrientation == UIInterfaceOrientationLandscapeRight));

任何建议使表视图仅转向横向视图?

1 个答案:

答案 0 :(得分:0)

将它放在viewDidLoad

self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
相关问题