概述
问题
What's the difference between android:textAlignment and android:gravity?
回答1:
All I can see is that the textAlignment is a member of the View Class and the gravity is the member of TextView class. So for the TextView and its subclasses you can use the gravity while you can use the textAlignment for all Views.
As the TextView and its subclasses need some more text-aligning features, so you can see there are more options in gravity where in textAlignment there are only basic options. Although it is only my guess because I have not found any clear documentation about the difference.
You can see these two links of documentation: textAlignment and gravity.
回答2:
With API 15, android:textAlignment may not have the desired result. The snippet below attempts to centre the first TextView object using android:textAlignment="center". The second uses android:gravity="center_h
最后
以上就是勤奋芒果为你收集整理的android:textalignment 参数解释,Text/Layout Alignment in Android (textAlignment, gravity)的全部内容,希望文章能够帮你解决android:textalignment 参数解释,Text/Layout Alignment in Android (textAlignment, gravity)所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复