0
我使用XML創建TabHost,並在使用findViewByID()的Activity中調用它。 我把tabhost和tabwidget的嚴重性是正確的,但它不是工作,我怎麼能使它工作?android:TabHost重力不起作用
注:我在活動提前
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_gravity="right" android:foregroundGravity="right" >
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/white">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:background="@drawable/submenu_bg" android:layout_gravity="right"/>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ProgressBar
android:id="@+id/loading_secondary_tabs"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_gravity="center" />
</FrameLayout>
</LinearLayout>
</TabHost>
我應該在哪裏使用它,因爲沒有android:重力在tabhost但有android:layout_gravity – 2012-04-03 18:01:52
設置爲您的** LinearLayout ** ... – waqaslam 2012-04-03 19:05:20