gpt4 book ai didi

iphone - TableView Controller 中的方向?

转载 作者:行者123 更新时间:2023-11-28 17:37:43 25 4
gpt4 key购买 nike

我的项目中有一个 TableView Controller (root)和 5 个 View Controller 。 View Controller 只转向横向 View (如我所愿)而不是 TableView Controller (仅在纵向 View 中)。在支持的设备方向中,我删除了纵向和颠倒,并且我在每个类中都写了:

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

有什么建议可以让表格 View 只变成横向 View 吗?

最佳答案

把它放在 viewDidLoad 中

self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

关于iphone - TableView Controller 中的方向?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9333558/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com