Android:图像和文本之间的空间

Android:图像和文本之间的空间,第1张

概述这是我的代码: <TextView android:id="@+id/error_text" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="2dp" android:gravity="center" 这是我的代码:

<TextVIEw    androID:ID="@+ID/error_text"    androID:layout_wIDth="match_parent"    androID:layout_height="wrap_content"    androID:layout_marginBottom="2dp"    androID:gravity="center"    androID:drawableRight="@drawable/error_image"    androID:visibility="invisible"    androID:textcolor="#aa0000"    androID:textStyle="bold"    androID:textSize="16dp"/>

图像文本之间有空间,我想减少这个空间,我该怎么办呢?

@R_419_6120@ 正如您设置了androID:layout_wIDth =“match_parent”,TextVIEw占用了所有宽度,因此您设置的drawablepadding将无法正常工作.所以你需要设置androID:layout_wIDth =“wrap_content”.

请尝试以下代码:

<TextVIEw    androID:ID="@+ID/error_text"    androID:layout_wIDth="wrap_content"    androID:layout_height="wrap_content"    androID:drawablepadding="0dp"    androID:layout_marginBottom="2dp"    androID:drawableRight="@drawable/ic_launcher"    androID:gravity="center"    androID:textcolor="#aa0000"    androID:textSize="16dp"    androID:text="adsfasdfa"    androID:textStyle="bold"    androID:visibility="invisible" />
总结

以上是内存溢出为你收集整理的Android:图像和文本之间的空间全部内容,希望文章能够帮你解决Android:图像和文本之间的空间所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/1122990.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-30
下一篇2022-05-30

发表评论

登录后才能评论

评论列表(0条)

    保存