使用 TabWidget.setDividerDrawable()?

发布于 2024-09-19 07:18:01 字数 272 浏览 0 评论 0原文

有人使用 TabWidget.setDivider() 取得过成功吗?我不确定它是否符合我的假设:让您有机会提供在每个选项卡实例之间绘制的可绘制对象?

mTabHost.getTabWidget().setDividerDrawable(R.drawable.dividerDrawable);

这似乎没有做任何事情。查看 android 项目中的选项卡可绘制资源表明,分隔线实际上是绘制到选项卡图像本身中的 - 这应该有效还是不支持?

Has anyone had any success with TabWidget.setDivider()? I'm not sure it does what I'm assuming: gives you a chance to supply a drawable to be drawn between each tab instance?

mTabHost.getTabWidget().setDividerDrawable(R.drawable.dividerDrawable);

this does not appear to do anything. Looking at the tab drawable resources in the android project shows that the dividers are actually drawn into the tab images themselves - is this supposed to work or is it not supported?

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

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

发布评论

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

评论(1

深者入戏 2024-09-26 07:18:02

在设置选项卡的内容之前调用它。否则它会崩溃。
类似的答案在这里

Call that before you set the content of the tabs.Or It would crash.
similar answer is here

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