选项卡按钮中的 Gremlin

发布于 2024-12-12 15:51:41 字数 254 浏览 2 评论 0原文

我是 Objective C 和 Xcode 的新手。我正在尽我所能构建一个 iPad 应用程序。

但我目前陷入困境。

我有一个选项卡式应用程序,底部有 3 个按钮。他们都工作。我想添加一个新按钮。但每次我使用 Interface Builder 将按钮添加到选项卡栏,甚至在选项卡栏周围移动按钮时,我都会进入模拟器,结果发现我失去了更改方向的能力。视图停留在纵向。如果我删除新按钮,或撤消移动,那么我将重新获得定向能力。

可能是什么原因造成的?

I'm new to Objective C and Xcode. I'm building an iPad app, the best that I can.

But I'm currently stuck.

I have a tabbed app, with 3 buttons at the bottom. They all work. I want to add a new button. But every time I use Interface Builder to add a button to my tab bar, or even move the buttons around the tab bar, I then go into the Simulator and it turns out that I've lost my ability to change orientation. The view is stuck in portrait. If I delete the new button, or undo the move, then I regain my powers of orientation.

What could be causing this?

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

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

发布评论

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

评论(1

护你周全 2024-12-19 15:51:41

您需要指定新的 ViewController 是否能够旋转,如果不能,则整个应用程序将不会带有 TabBar。

- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return YES;
}

You need to specify the new ViewController is able to rotate, if one can't then the whole app won't with a TabBar.

- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return YES;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文