问题
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内容请搜索靠谱客的其他文章。
发表评论 取消回复