Как уменьшить отступ вокруг текста в макете Android xml?

У меня есть текст высотой 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>

На этом снимке экранаВы можете видеть, что граница или поле вокруг фонда — это область, которую я хочу уменьшить.

Screen Shot

5
задан Allen Edwards 9 August 2012 в 17:41
поделиться