我如何在TabHost所有选项卡未选定 [英] How do I make all tabs in a TabHost unselected

查看:161
本文介绍了我如何在TabHost所有选项卡未选定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要出示际标签的内容,否则该地区必须充满非tabhostdata.However,标签应该是可见的,用户点击任何这些标签的时候非tabhost必须隐藏和适当的标签内容必须变得可见。

I need to show tab content on occasion, otherwise the area must be filled with "non-tabhost" data.However, tabs should be visible and when user clicks any of those tabs "non-tabhost" must be hidden and appropriate tab content must become visible.

这件事情连接到一个假的标签创作?

It's something connected to a fake tab creation ?

使与标签未被选择创建TabHost的一个例子。
谢谢你。

Give an example of creating TabHost with tabs unselected. Thanks.

推荐答案

我最常做的是,添加一个额外的设置页,并使用 setVisibility( View.GONE)来隐藏它。这只是对用户隐藏的选项卡按钮,设置页依然存在,在后台,你可以通过编程选择它,使用 tabHost.setCurrentTab(0)。我平时也保持这个标签作为第一个。

What I usually do is, add an extra Tab and use setVisibility(View.GONE) to hide it. THis will just hide the tab button from the user, and the Tab will still be there, in the "background" and you can programmatically select it, by using tabHost.setCurrentTab(0). I also usually keep this tab as the first one.

这篇关于我如何在TabHost所有选项卡未选定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆