Android的减少两个垂直TextViews之间的空间 [英] android reduce space between two vertical TextViews
问题描述
我在我的应用程序两个垂直的TextView元素。
有很多之间TextViews,pading和layoutMargin 0
I have two vertical TextView elements in my app. There is lot of space between TextViews, pading and layoutMargin are 0
有没有办法减少这个空间?
Is there way to reduce this space?
编辑
这里是我的code:
EDIT Here is my code:
.
.
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="right"
android:paddingRight="10dp"
android:layout_weight="1">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/text_size_extra_small"
android:textColor="@color/home_tab_text_normal"
android:text="Test1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/orange_text_color"
android:textSize="@dimen/text_size_large"
android:textStyle="bold"
android:text="Text2"/>
</LinearLayout>
.
.
Thnaks
Thnaks
推荐答案
切缘阴性,可以通过两种方法来设置 -
Negative Margins can be set by two methods -
1)通过XML - 将机器人:Layout_marginTop字段负 - 这等人已经提出上述
1) by xml - set the "android:Layout_marginTop" field negative - which other people have already suggested above
2)的Java(编程) - 的LayoutParams的TOPMARGIN字段设置为负
2) by java (Programmatically) - set the "topMargin" field of LayoutParams to negative.
您也可以参考<一个href=\"http://stackoverflow.com/questions/10769815/remove-space-between-stacked-textviews/16932953#16932953\">this
这篇关于Android的减少两个垂直TextViews之间的空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!