2014-02-25 16 views
0

helllo,我嘗試創建標籤視圖必須有一些元素在我的情況下他們是seekbar和水平線性佈局與2 textview,但它只顯示這樣的元素在頂部。 這樣的形象在:此選項卡的標籤主機不顯示所有元素

enter image description here

XML代碼:

     <LinearLayout 
          android:id="@+id/tvTab2" 
          android:layout_width="match_parent" 
          android:layout_height="match_parent" 
          android:orientation="vertical" 
          > 
         <LinearLayout 
           android:orientation="horizontal" 
           android:layout_width="match_parent" 
           android:layout_height="match_parent"> 
          <TextView 
            android:text="@string/bspa_count_of_hours" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content"> 
          </TextView> 
          <TextView 
            android:id="@+id/bspa_count_of_hours_value" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content"> 
          </TextView> 
         </LinearLayout> 
         <SeekBar 
           android:id="@+id/bspa_seekbar_count_of_hours" 
           android:layout_width="match_parent" 
           android:layout_height="wrap_content" 
           /> 

        </LinearLayout> 
+0

'機器人:layout_height = 「match_parent」'應該是' android:layout_height =「wrap_content」內部的LinearLayout填充父項。 –

回答

1

試試這個: -

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/tvTab2" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" > 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal" > 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="bspa_count_of_hours" > 
     </TextView> 

     <TextView 
      android:id="@+id/bspa_count_of_hours_value" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" > 
     </TextView> 
    </LinearLayout> 

    <SeekBar 
     android:id="@+id/bspa_seekbar_count_of_hours" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" /> 

</LinearLayout> 
+0

謝謝,作品:) – Abbath

+0

我的榮幸!! .. 接受我的答.. – Namy