【发布时间】:2013-09-28 18:54:45
【问题描述】:
我想开发像所附图片一样的标签。但是,不想为此使用 Tabhost。非常感谢任何帮助。
下面是正在使用的 XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:background="#0C3666"
android:orientation="horizontal"
android:weightSum="1.0" >
<TextView
android:id="@+id/news_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:background="@drawable/tab_drawable"
android:clickable="true"
android:gravity="center"
android:padding="10dp"
android:text="NEWS"
android:textColor="@color/main_white"
android:textSize="14dp" />
<TextView
android:id="@+id/quotes_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:background="@drawable/tab_drawable"
android:clickable="true"
android:gravity="center"
android:padding="10dp"
android:text="QUOTES"
android:textColor="@color/main_white"
android:textSize="14dp" />
<TextView
android:id="@+id/editor_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:background="@drawable/tab_drawable"
android:clickable="true"
android:gravity="center"
android:padding="10dp"
android:textColor="@color/main_white"
android:textSize="14dp" />
<TextView
android:id="@+id/st_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:background="@drawable/tab_drawable"
android:gravity="center"
android:padding="10dp"
android:text="ST"
android:textColor="@color/main_white"
android:textSize="14dp" />
</LinearLayout>
上面是布局。我想知道如何绘制分隔线“|”选项卡之间。
【问题讨论】:
-
this的可能重复
-
谢谢,但您提供的链接没有帮助。
-
然后给出更多细节,比如你想在哪里显示它,否则操作栏可以用于一般情况
-
您至少尝试过什么吗?您可以使用按钮、TextViews 自定义视图等...
标签: android