Android 中的文本/布局对齐(textAlignment、gravity) [英] Text/Layout Alignment in Android (textAlignment, gravity)

查看:28
本文介绍了Android 中的文本/布局对齐(textAlignment、gravity)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

android:textAlignmentandroid:gravity 有什么区别?

推荐答案

我只能看到 textAlignment 是 View Class 的成员,gravity 是 TextView 类的成员.因此,对于 TextView 及其子类,您可以使用重力,而您可以对所有视图使用 textAlignment.

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.

由于 TextView 及其子类需要更多文本对齐功能,因此您可以看到重力中有更多选项,而 textAlignment 中只有基本选项.虽然这只是我的猜测,因为我还没有找到任何关于差异的明确文档.

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.

你可以看到这两个文档链接:textAlignment重力.

You can see these two links of documentation: textAlignment and gravity.

这篇关于Android 中的文本/布局对齐(textAlignment、gravity)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆