我是靠谱客的博主 听话铅笔,这篇文章主要介绍android:textAlignment 属性,现在分享给大家,希望可以做个参考。

https://developer.android.google.cn/reference/android/view/View?hl=en#attr_android:textAlignment

API 17 时添加的属性,一直没用到过,记录一下这个简单的属性
android:textAlignment 支持以下属性值

ConstantValueDescription
center4Center the paragraph, for example: ALIGN_CENTER.
gravity1Default for the root view. The gravity determines the alignment, ALIGN_NORMAL, ALIGN_CENTER, or
inherit0Default.
textEnd3Align to the end of the paragraph, for example: ALIGN_OPPOSITE.
textStart2Align to the start of the paragraph, for example: ALIGN_NORMAL.
viewEnd6Align to the end of the view, which is ALIGN_RIGHT if the view’s resolved layoutDirection is LTR, and ALIGN_LEFT otherwise.
viewStart5Align to the start of the view, which is ALIGN_LEFT if the view’s resolved layoutDirection is LTR, and ALIGN_RIGHT otherwise.

textEndviewEnd 的不同,正如上述英文描述的一样,layoutDirection 不一样的时候有所不同
下面展示在设置了 android:textDirection="rtl" 的文字显示效果

复制代码
1
2
3
android:textAlignment="viewEnd" android:textDirection="rtl

在这里插入图片描述

复制代码
1
2
3
android:textAlignment="textEnd" android:textDirection="rtl"

在这里插入图片描述

最后

以上就是听话铅笔最近收集整理的关于android:textAlignment 属性的全部内容,更多相关android:textAlignment内容请搜索靠谱客的其他文章。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部