2014-02-25 15 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