我正在使用TabHost和TabWidget爲Android應用程序創建一些選項卡。我發現標籤垂直顯示出來。有什麼辦法可以製作水平對齊的標籤(一個在另一個之上)?是否可以在Android OS中創建水平製表符?
我創建的標籤是這樣的:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/textview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="this is a tab" />
<TextView
android:id="@+id/textview2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="this is another tab" />
</FrameLayout>
</LinearLayout>
像這樣的東西是什麼,我需要做的:
我實際上在這一天搞砸了,我無法得到任何有用的東西。問題是tabwidget。所有的tabwidget都是線性佈局。所以你可以繼承線性佈局來自己做。 – Falmarri 2010-10-21 20:58:16