2014-01-05 14 views
0

有沒有人知道爲什麼我刪除包含EditText的背景屬性時,我的表格行高度增加?爲什麼刪除包含EditText的背景會增加行高?

<TableLayout 
     android:id="@+id/tableLayout1" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:stretchColumns="1,3" > 

     <TableRow 
      android:id="@+id/tr3a" 
      android:padding="2.5dp" 
      android:background="@color/col1" 
      android:gravity="center_vertical" 
      android:layout_width="fill_parent" 
      android:layout_height="0dp" 
      android:layout_weight="1" > 

      <TextView 
       android:id="@+id/lab_bookname" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="@string/bookname" /> 

      <EditText 
       android:id="@+id/bookname" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="5dp" 
       android:layout_marginRight="5dp" 
       android:layout_span="3" 
       android:textSize="14sp" 
       android:background="@color/white" // FOR VIEW 1, I REMOVE THIS LINE, NO OTHER CHANGE 
       android:hint="@string/definputtext2" /> 

     </TableRow> 

enter image description here

+0

變化通過DP即高度使用'機器人:layout_height = 「15dp」' –

+0

爲什麼layout_height應區別有和沒有背景的行動? – abdfahim

+1

我不知道,但這個問題也面臨着我,但設置高度幫助我! –

回答