如何删除标签控件之间的空间?控件、标签、空间

2023-09-04 12:46:43 作者:习惯。

我想删除tabwidgets之间的间距。默认情况下有标签之间围绕1px的间隔。我知道像方正或posterous一些应用程序可以将其删除。如何为code要做到这一点会是什么样子?我使用的2.3 API。

I would like to remove the spacing between tabwidgets. By default there is around 1px spacings between tabs. I know some apps like foursquare or posterous are able to remove it. How is the code to do this would look like? I am using 2.3 API.

感谢您的帮助

推荐答案

您可以使用getTabHost()。getTabWidget()。setDividerDrawable(R.drawable.empty_divider)方法, 其中,R.drawable.empty_divider简洁的外形与0px大小,如

You can use getTabHost().getTabWidget().setDividerDrawable(R.drawable.empty_divider) method, where R.drawable.empty_divider simple shape with 0px size, such as

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="line" >
    <size
        android:width="0px"
        android:color="@android:color/black"
        android:dashWidth="0px"
        android:dashGap="0px" />
</shape>