iPad 上的选项卡视图无法调整大小

发布于 2024-09-13 06:57:06 字数 394 浏览 17 评论 0原文

我的视图无法拉伸以适应当前方向!

我正在创建一个标签栏应用程序。我复制了您在“创建新的选项卡栏应用程序”时创建的示例。一切正常,除了当我更改 iPad 的方向时,它会旋转视图,选项卡栏在底部延伸,但视图不会调整大小。基本上,如果您从横向开始然后旋转到纵向,它会旋转,但视图仍然是横向形状,即使它旋转。

我的选项卡栏有两个选项卡(就像示例应用程序一样),因此我将我的选项卡与按属性工作的示例进行了比较。一个区别是我注意到 IB 中调整大小区域下的 FirstView 没有显示左/右上/下调整大小箭头。换句话说,它没有被标记为自动填充其容器。示例的 FirstView 和 SecondView 有这些箭头。但我无法打开它们!

我什至尝试创建一个全新的视图,但我仍然无法按下这些箭头。我在这里做错了什么?

多谢。

My view doesn't stretch to fit the current orientation!

I am creating a tab bar application. I replicated the sample one that you create when you "create a new tab bar application". Everything works except when I change the orientation of the iPad it rotates the view, the tab bar stretches out on the bottom, but the view doesn't resize. Basically if you start in landscape then rotate to portrait, it rotates but the view is still landscape shape even though it rotates.

My tab bar has two tabs (just like the sample application) and so I compared mine against the sample which works property by property. One difference is I noticed my FirstView in IB under the resizing area doesn't show the resize arrows left/right up/down. In other words it isn't marked to auto fill its container. The sample's FirstView and SecondView DO have these arrows. But I can't turn them on!

I even tried creating a fresh new view but I still can't press these arrows on. what am I doing wrong here?'

Thanks a lot.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

笑咖 2024-09-20 06:57:06

解决方案是这样的:

self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

在 viewDidLoad 中执行此操作。 IB一定有bug。

The solution is this:

self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

Do this in viewDidLoad. There must be a bug in IB.

鹤仙姿 2024-09-20 06:57:06

另一个答案是关闭 Interface Builder 视图上的任何模拟选项卡栏、导航栏或状态栏。进入自动调整大小区域并打开自动增长箭头。然后重新打开模拟用户元素。

Another answer is turning off any simulated tabbars, nav bars, or status bars on the view in Interface Builder. Go into the autosizing area and turn on the auto grow arrows. Then turn back on the simulated user elements.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文