我想开发类似附加图像的选项卡。但是,不希望为此使用Tabhost。任何帮助都非常值得赞赏。 选项卡 - 不使用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>
以上就是布局。我想知道我可以如何绘制分隔线“|”在标签之间。
可能重复的图像的背景(http://stackoverflow.com/questions/13505236/how-to-implement-android-tab-menu -without-deprecated-tabhost) – r4jiv007
谢谢,但你提供的链接是没有用的。 – user694688
使用操作栏http://www.javacodegeeks.com/2013/06/android-action-bar-with-tab.html和http://www.vogella.com/articles/AndroidActionBar/article.html可能会对您有所帮助为你 – guptakvgaurav