以编程方式选择的选项卡不显示突出显示叠加

发布于 2024-09-04 13:33:35 字数 472 浏览 4 评论 0原文

我正在尝试以编程方式切换选项卡。我尝试使用以下调用来执行此操作:

tabBarController.selectedIndex = 2;
tabBarController.selectedViewController = checkinViewController;


在这两种情况下,这就是我得到的:

alt text http://cl.ly/ 1Gia/内容

就是我想要的:

替代文本 http: //cl.ly/1GKE/content


有任何线索吗?

I'm trying to programmatically switch tabs. I tried to do this using the following calls:

tabBarController.selectedIndex = 2;
tabBarController.selectedViewController = checkinViewController;

In both cases, This is what I get:

alt text http://cl.ly/1Gia/content

This is what I want:

alt text http://cl.ly/1GKE/content

Any clue?

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

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

发布评论

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

评论(1

肥爪爪 2024-09-11 13:33:35

为此属性分配新的视图控制器会更改当前显示的视图,并在选项卡栏中选择适当的选项卡。更改视图控制器也会相应地更新 selectedIndex 属性。

也许只是尝试不使用 selectedIndex ?另外,那里有第四个选项卡项目吗?如果只有 3 个,则 selectedIndex = 2 将是“更多”按钮,并且:

尝试将此值设置为
不是视图控制器的索引
在选项卡栏中可见,但改为
由更多导航管理
控制器,没有效果。

一些想法,不确定这是否是答案。

Assigning a new view controller to this property changes the currently displayed view and also selects an appropriate tab in the tab bar. Changing the view controller also updates the selectedIndex property accordingly.

Maybe just try without the selectedIndex? Also, is there a fourth tab item in there? If there's only 3, then selectedIndex = 2 would be the more button and:

Attempting to set this value to an
index of a view controller that is not
visible in the tab bar, but is instead
managed by the More navigation
controller, has no effect.

Some thoughts, not sure if this is the answer.

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