如何减少Android xml布局中文本周围的填充?

All*_*rds 5 android android-layout

我有1英寸高的文字,但视图的框占用1.5英寸所以在白色字体的上方和下方有1/4英寸的黑色空间.我希望减少1/4英寸,这样我就可以在6英寸屏幕上获得5行文字而不是4行.我可以将它们与android一起移动得更近:lineSpacingMultiplier =".66"但这只会让盒子更接近在一起,1/4英寸的黑色空间覆盖了附近线条的文字.android:includeFontPadding ="false"什么都不做.否定填充没有任何作用.放入android:lineSpacingExtra =" - 50sp"也只有黑色边距覆盖相邻的文本行.我想摆脱边际(实际上,只是大部分).

我已经尝试了我能想到的每一个选项,包括上面讨论的明显的填充和边距以及填充,包括零和负数.我找不到一个简单的图表,显示在实际文本上方的视图中控制空间的内容.

如何减少浪费的空间?

(我的互联网在过去2小时内停机,所以我花了一些时间回复.抱歉)

这是我的XML:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<TextView
    android:id="@+id/textTimer"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:includeFontPadding="false"
    android:text="10.01"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:textSize="@dimen/font_size" />


<TextView
    android:id="@+id/textTimeToLine"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/textTimer"
    android:layout_centerHorizontal="true"
    android:includeFontPadding="false"
    android:text="10.02"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:textSize="@dimen/font_size" />

<TextView
    android:id="@+id/textTimeToKill"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/textTimeToLine"
    android:layout_centerHorizontal="true"
    android:includeFontPadding="false"
    android:text="10.03"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:textSize="@dimen/font_size" />

<TextView
    android:id="@+id/textTimeToPin"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/textTimeToKill"
    android:layout_centerHorizontal="true"
    android:includeFontPadding="false"
    android:text="10.03"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:textSize="@dimen/font_size" />

<TextView
    android:id="@+id/textTimeToCB"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/textTimeToPin"
    android:layout_centerHorizontal="true"
    android:includeFontPadding="false"
    android:text="10.03"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:textSize="@dimen/font_size" />

    <Button
    android:id="@+id/buttonMenu"
    style="?android:attr/buttonStyleSmall"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_alignParentTop="true"
    android:text="Menu" 
    android:onClick="onMenu"
    android:focusable="false"/>

</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

在此屏幕截图中,您可以看到喜欢的边界或边距是我想要减少的区域.

屏幕截图

Ifo*_*for 5

一些负的顶部和底部边距。但如果你有精美的背景,事情就会变得混乱。