android - 如何删除选项卡小部件之间的空格?

标签 android tabs android-2.3-gingerbread

我想删除标签小部件之间的间距。默认情况下,选项卡之间的间距约为 1px。我知道 foursquare 或 posterous 等一些应用程序能够将其删除。执行此操作的代码是什么样的?我正在使用 2.3 API。

谢谢你的帮助

最佳答案

您可以使用 getTabHost().getTabWidget().setDividerDrawable(R.drawable.empty_divider) 方法, 其中 R.drawable.empty_divider 具有 0px 大小的简单形状,例如

<?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>

关于android - 如何删除选项卡小部件之间的空格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5805223/

相关文章:

android - 以编程方式更改 R.String 的值

android - 更新后 APK 支持的设备比以前少

android getBearing 未按预期运行

android - 布局问题 : how to place something on top and bottom?

java - 为什么我的 arduino uno with xbee shield v1.4 with bluetooth bee 没有从 android 接收任何数据?

javascript - Bootstrap 选项卡内容 slideDown/slideUp 不起作用

javascript - 具有多重折叠的 Bootstrap 导航堆叠标签

winapi - 如何向 Tab 控件添加控件

android - Intent 值未传递回启动 Activity

android - Lint 在组装发布目标时发现 fatal error