0

enter image description hereTextView的拍攝/消耗的上方和下方的文本

包圍的文本視圖太多空間具有上面和下面它的文本太多空間。它在文本視圖內(不在其上面和下面)。我沒有使用利潤率和填充,但它仍然存在。 xml代碼就在那裏。

<TableRow 
     android:id="@+id/tbRow" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/viewLineSeparator" 
     android:layout_gravity="top" 
     android:layout_marginBottom="2dp" 
     android:layout_marginTop="1dp" 
     android:gravity="top" 
     android:weightSum="1.0" > 
     <TextView 
      android:id="@+id/tvReportAsAdult" 
      android:layout_width="0dp" 
      android:layout_height="match_parent" 
      android:layout_gravity="left|top" 
      android:layout_weight="0.60" 
      android:clickable="true" 
      android:gravity="left|top" 
      android:maxLines="5" 
      android:padding="11dp" 
      android:text="@string/txtReportAsAdultText" 
      android:textColor="#00BFFF" 
      android:textSize="18sp" /> 
     <LinearLayout 
      android:layout_width="0dp" 
      android:layout_height="wrap_content" 
      android:layout_gravity="right|center" 
      android:layout_weight="0.40" 
      android:gravity="center" 
      android:weightSum="1.0" > 

      <ImageButton /> 
      <ImageButton /> 
      <ImageButton /> 
      <ImageButton /> 

     </LinearLayout> 
    </TableRow> 

此tableRow是一個RelativeLayout的子元素,它是ScrollView的子元素。而這個空間只是由於textview造成的,即它既不是由於圖像瀏覽也不是由於顯示。

+0

你張貼前人的精力完整的XML或包括上方和下方的佈局代碼。和cource圖像按鈕佈局 –

回答

1

您使用

android:padding="11dp" 

這是設置11 DP填充在TextView中的各個側面。單獨使用填充通過使用

paddingToppaddingBottompaddingLeftPaddingRight