2011-05-09 14 views
0

私のアプリケーションにはタブバーがあります。それは私がリストビューを表示している4つのタブが含まれています。うまくいきましたが、今はタブバーを画面の下に移動する必要があります。ビューの一番下にタブバーを表示するようにコードを変更したとき、リストビューはタブバーにオーバーラップしてフルスクリーンで表示されます。ここでアンドロイドのビューの下にタブバーを追加する際の問題

は、私は誰もがこの解決策を提案することができますしてください、次のコード

tabHost.addTab(tabHost.newTabSpec(NEW_TAB).setIndicator(NEW) 
      .setContent(new Intent(this, NEWActivity.class))); 

と4つのそれぞれのタブで4つのリストビューを追加していたサンプルコード

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      android:id="@+id/mainlayout" 
      android:layout_height="fill_parent" 
      android:layout_width="fill_parent" 
      android:orientation="vertical" > 
    <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:orientation="vertical" 
     android:background="#000000"> 

     <RelativeLayout 
      android:orientation="vertical" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:padding="5dp"> 

      <TextView xmlns:android="http://schemas.android.com/apk/res/android" 
        android:id="@+id/Label" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:text="Credit Balance" 
        android:background = "#55000000" 
        android:textColor = "#FF0033" 
      /> 

      <TabWidget 
        android:id="@android:id/tabs" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        **android:layout_alignParentBottom = "true"**/> 
      <FrameLayout 
        android:id="@android:id/tabcontent" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:padding="5dp" /> 
     </RelativeLayout> 
    </TabHost> 
</FrameLayout> 

のですか?

おかげ

答えて

3

はあなたでframeLayoutにこの

android:layout_above="@android:id/tabs" 

の行を追加していいとストレートanswer.Itsが正常に動作して

android:layout_alignParentBottom = "true" 

TabWidgetで

+0

おかげSujitと。 – Rishi

+0

+1ありがとうございました...この1時間を1時間外に出そうとしています –

関連する問題