问题描述
是Android:分隔属性下TabWidget工作?我试图从机器人只是为了测试选项卡布局教程(http://developer.android.com/resources/tutorials/views/hello-tabwidget.html),并设置了android:分频器一些图像(现在我用了android垂直滚动条的绘制真正强调如果得到回升(复制它的框架),但是当我运行它在模拟器上,它似乎并不奏效。根据文档,该TabWidget似乎支持这种属性:可绘制用于绘制标签之间的分隔符
Is the android:divider attribute under the TabWidget working? I tried the Tab Layout tutorial from android just to test (http://developer.android.com/resources/tutorials/views/hello-tabwidget.html) and set the android:divider to some image (for now I used the android vertical scrollbar as the drawable to really emphasize if its getting picked up (copied it from frameworks), but when I ran it on the emulator, it doesn't appear to be working. According to the docs, the TabWidget does seem to support this attribute: "Drawable used to draw the divider between tabs."
谁能帮助?我使用的是九补丁绘制作为我的分频器图像绘制。
Can anyone help? I am using a nine-patched drawable as my divider image drawable.
MB
推荐答案
它看起来并不像分
属性可用于再 TabWidget
。添加自定义分频器的一种方法是编程方式设置它
It doesn't look like the divider
attribute is available anymore for TabWidget
. One way to add a custom divider is to set it programmatically:
mTabHost.getTabWidget().setDividerDrawable(R.drawable.divider_vertical_dark);
确认然而,你叫这个的在的设置选项卡的内容。它会崩溃的我,如果我以后叫吧。
Make sure however, you call this before you set the content of the tabs. It would crash on me if I called it after.
这篇关于TabWidgets之间的分隔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!