更改 TabActivity 中的选项卡背景颜色
我正在尝试更改 TabActivity
中选项卡的背景颜色。 为此,我确实喜欢下面的内容,
tabHost.getTabWidget().getChildAt(totalTabs1-1).setBackgroundColor(Color.parseColor("#984b9d"));
但它不能正常工作,如我想要的。
还有其他方法吗?
谢谢
I am trying to change the background color of tab in TabActivity
.
for that I did like below,
tabHost.getTabWidget().getChildAt(totalTabs1-1).setBackgroundColor(Color.parseColor("#984b9d"));
but its not working properly what i want.
Is there any other way to do it?
Thank You
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为此,您必须在可绘制文件夹内为选项卡选择器编写一个 xml 文件。
tab_selector.xml
并在选项卡初始化时执行如下操作,
For this u have to write a xml file for tab selector inside drawable folder.
tab_selector.xml
and at the time of initialization of tab just do like below,
你可以试试这个:
You can try this:
使用以下
use following