如何减少Android布局中文本之间的行距?

如何减少Android布局中文本之间的行距?,android,android-layout,line,textview,spacing,Android,Android Layout,Line,Textview,Spacing,我想减少附加版面中文本之间的行距(User12,5部电影,提高了2.5%) 下面是xml(我尝试删除singleLine=“true”语句并尝试将其设置为false): 问题提出已经很久了,但如果将来有人需要答案,只需将负值传递给 android:lineSpacingExtra="-4dp" 正如上面Cullan所说,您必须输入一个负的边距值: android:layout_marginTop=“-10dp” 希望这对某人有所帮助。在这种情况下,设置lineSpacingMultipl

我想减少附加版面中文本之间的行距(User12,5部电影,提高了2.5%)

下面是xml(我尝试删除singleLine=“true”语句并尝试将其设置为false):


问题提出已经很久了,但如果将来有人需要答案,只需将负值传递给

android:lineSpacingExtra="-4dp"

正如上面Cullan所说,您必须输入一个负的边距值:

android:layout_marginTop=“-10dp”



希望这对某人有所帮助。

在这种情况下,设置lineSpacingMultiplier似乎比lineSpacingExtra更好,例如

android:lineSpacingMultiplier=“0.8”


(如果您的所有文本都在一个文本视图中,且该视图在xml中有上一行,则此选项有效。)

问题表示LinearLayout中每个组件之间的问题。这一个只适用于文本视图。请看下面我的回答。负值减少下面的行字符,如“g”,将从底部减少。它是有效的,而且,从我所看到的,它不会减少字母的较低部分,如“g”或“p”。这是唯一对我有效的解决方案。其他的都没用。
android:lineSpacingExtra="-4dp"
<TextView
    android:id="@+id/scoreDesc"
    android:text="User12"
    android:layout_marginLeft="5dip"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:textAppearance="@android:style/TextAppearance.Small"
    android:singleLine="true"
    android:ellipsize="marquee"
    android:layout_weight="1"
    android:layout_gravity="center_vertical" />
<TextView
    android:id="@+id/scoreDesc"
    android:text="5 movies"
    android:layout_marginLeft="5dip"
    android:layout_marginTop="-10dp"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:textAppearance="@android:style/TextAppearance.Small"
    android:singleLine="true"
    android:ellipsize="marquee"
    android:layout_weight="1"
    android:layout_gravity="center_vertical" />