TextView中服用/消费上面和下面的文字太多空间 [英] TextView taking/consuming too much space above and below the text
问题描述
正如你所看到guyz,包围文本视图具有上方和下方的文字太多空间。它是文本视图(而不是上面和下面的话)内。我既不用利润率也不垫,但它仍然在那里。该XML code是存在的。
As you can see guyz, the text view encircled has too much space above and below its text. It is inside the text view (not above and below of it). I neither used margins nor paddings but it is remained there. The xml code is there.
<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的进一步滚动型是一个孩子的孩子。的空间,仅仅是由于TextView的,即其既不由于imageviews也不tablerow的。
This tableRow is a child of a RelativeLayout which is further a child of ScrollView. And the space is only due to textview i.e. its neither due to imageviews nor tablerow.
问候,
推荐答案
在使用
android:padding="11dp"
这是在TextView中的所有侧面设置11 DP填充。通过使用单独使用填充
which is setting 11 dp padding in all sides of the textview. use padding separately by using
<$c$c>paddingTop$c$c>,<$c$c>paddingBottom$c$c>,<$c$c>paddingLeft$c$c>,<$c$c>PaddingRight$c$c>
这篇关于TextView中服用/消费上面和下面的文字太多空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!