我是靠谱客的博主 勤奋芒果,这篇文章主要介绍android:textalignment 参数解释,Text/Layout Alignment in Android (textAlignment, gravity),现在分享给大家,希望可以做个参考。

问题

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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(48)

评论列表共有 0 条评论

立即
投稿
返回
顶部