我在 xml
中有一个 TextView
,但是我在 java 中给 TextView
值,同时显示它没有正确对齐。请问你能给出解决方案。
在 Xml
中,我给出的值意味着它显示正确,但在 java 中,我给出的值没有以正确的方式显示。我想证明文本的合理性
<TextView
android:text="" android:id="@+id/result"
android:layout_marginTop="13dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="left|center|right"
android:gravity="left|center|right"
android:textStyle="bold"
android:textAlignment="center"
android:layout_marginRight="5dp"
android:layout_marginLeft="5dp"
android:textSize="15dp" />
最佳答案
Android 0 支持 TextView 对齐。请点击以下链接
您还可以使用以下库进行文本对齐。
希望对你有帮助
关于android - 如何在 android 的 textview 中对齐文本并正确对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48900837/