0

現在、Androidでタブバーアプリケーションを使用しています。ここで私はあなたの参照用のコードに言及しました、私はウェブを参照します、見つかったリンクのいくつか(android:layout_alignParentBottom = "true")はTabWidgetにこの行を挿入しますが、タブバーはトップにのみ表示されるので、私を助けてください

前もって感謝します

<?xml version="1.0" encoding="utf-8"?>

<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/tabhost"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="#EBF1FF">

  <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_alignParentBottom = "true" <=======
      android:layout_height="wrap_content"
     />

    <FrameLayout android:id="@android:id/tabcontent"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent">
4

2 に答える 2

1

が..内にある場合にandroid:layout_alignParentBottom = "true"のみ機能します。TabWidgetRelativeLayout

<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<TabWidget android:id="@android:id/tabs"
  android:layout_width="fill_parent"
android:layout_alignParentBottom = "true" 
 android:layout_height="wrap_content" />

<FrameLayout android:id="@android:id/tabcontent"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"> 
</RelativeLayout>
于 2012-07-20T06:47:24.053 に答える
0

TabWidget に置くだけFrameLayoutです。

android:tabStripEnabled="false"また、タブウィジェットの下にあると見栄えが悪いため、ストリップをタブウィジェットの下に非表示にするために使用します。

于 2012-07-20T07:03:12.847 に答える