Text 文本(18)

属性名 取值 描述
color <color> 对应 CSS color 属性
fontFamily string 对应 CSS font-family 属性
fontSize <number> 对应 CSS font-size 属性
fontStyle normal, italic 对应 CSS font-style 属性,但阉割了 oblique 取值
fontWeight normal, bold 100~900 对应 CSS font-weight 属性,但阉割了 bolder, lighter 取值
lineHeight <number> 对应 CSS line-height 属性
textAlign auto, left, right, center, justify``iOS 对应 CSS text-align 属性,但增加了 auto 取值。当取值为 justify 时,在 Android 上会变为 left
textDecorationLine none, underline, line-through, underline line-through 对应 CSS text-decoration-line 属性,但阉割了 overline, blink 取值
textShadowColor <color> 对应 CSS text-shadow 属性中的颜色定义
textShadowOffset { width:<number>, height:<number> } 对应 CSS text-shadow 属性中的阴影偏移定义
textShadowRadius <number> 在 CSS 中,阴影的圆角大小取决于元素的圆角定义,不需要额外定义
includeFontPadding Android <bool> Android在默认情况下会为文字额外保留一些padding,以便留出空间摆放上标或是下标的文字。对于某些字体来说,这些额外的padding可能会导致文字难以垂直居中。如果你把textAlignVertical设置为center之后,文字看起来依然不在正中间,那么可以尝试将本属性设置为false
textAlignVertical Android auto, top, bottom, center 对应 CSS vertical-align 属性,增加了 auto 取值,center 取代了 middle,并阉割了 baseline, sub 等值
fontVariant iOS small-caps, oldstyle-nums, lining-nums, tabular-nums, proportional-nums 对应 CSS font-variant 属性,但取值更丰富
letterSpacing iOS <number> 对应 CSS letter-spacing 属性
textDecorationColor iOS <color> 对应 CSS text-decoration-color 属性
textDecorationStyle iOS solid, double, dotted, dashed 对应 CSS text-decoration-style 属性,但阉割了 wavy 取值
writingDirection iOS auto, ltr, rtl 对应 CSS direction 属性,增加了 auto 取值