参见英文答案 >
Remove space between stacked TextViews8个
我的应用程序中有两个垂直TextView元素.
TextViews之间有很多空间,pading和layoutMargin都是0
我的应用程序中有两个垂直TextView元素.
TextViews之间有很多空间,pading和layoutMargin都是0
有没有办法减少这个空间?
编辑
这是我的代码:
. . <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
解决方法
负边距可以通过两种方法设置 –
1)通过xml – 将“android:Layout_marginTop”字段设置为否定 – 其他人已经在上面建议过了
2)通过java(以编程方式) – 将LayoutParams的“topMargin”字段设置为负数.
您也可以参考this
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。