android:textAlignment 属性
https://developer.android.google.cn/reference/android/view/View?hl=en#attr_android:textAlignmentAPI 17 时添加的属性,一直没用到过,记录一下这个简单的属性android:textAlignment 支持以下属性值ConstantValueDescriptioncenter4Center the p
·
https://developer.android.google.cn/reference/android/view/View?hl=en#attr_android:textAlignment
API 17 时添加的属性,一直没用到过,记录一下这个简单的属性
android:textAlignment
支持以下属性值
Constant | Value | Description |
---|---|---|
center | 4 | Center the paragraph, for example: ALIGN_CENTER. |
gravity | 1 | Default for the root view. The gravity determines the alignment, ALIGN_NORMAL, ALIGN_CENTER, or |
inherit | 0 | Default. |
textEnd | 3 | Align to the end of the paragraph, for example: ALIGN_OPPOSITE. |
textStart | 2 | Align to the start of the paragraph, for example: ALIGN_NORMAL. |
viewEnd | 6 | Align to the end of the view, which is ALIGN_RIGHT if the view’s resolved layoutDirection is LTR, and ALIGN_LEFT otherwise. |
viewStart | 5 | Align to the start of the view, which is ALIGN_LEFT if the view’s resolved layoutDirection is LTR, and ALIGN_RIGHT otherwise. |
textEnd
与viewEnd
的不同,正如上述英文描述的一样,layoutDirection
不一样的时候有所不同
下面展示在设置了 android:textDirection="rtl"
的文字显示效果
android:textAlignment="viewEnd"
android:textDirection="rtl
android:textAlignment="textEnd"
android:textDirection="rtl"
更多推荐
已为社区贡献7条内容
所有评论(0)