参考
color
fontFamily
iOS 支持通用字体系列 system-ui、ui-sans-serif、ui-serif、ui-monospace 和 ui-rounded。
fontSize
fontStyle
fontWeight
指定字体粗细。大多数字体支持 'normal' 和 'bold' 值。并非所有字体都为每个数值提供变体,在这种情况下,会选择最接近的一个。
| 类型 | 默认 |
|---|
枚举('normal','bold','100','200','300','400','500','600','700','800','900')或数字 | 'normal' |
includeFontPadding
Android
设置为 false 可移除为某些升部/降部留出空间的额外字体内边距。对于某些字体,此内边距会使文本在垂直居中时看起来略微不对齐。为获得最佳效果,还将 textAlignVertical 设置为 center。
fontVariant
允许您设置字体的所有字体变体。可以使用枚举数组或空格分隔的字符串设置,例如 'small-caps common-ligatures'。
| 类型 | 默认 |
|---|
枚举数组('small-caps','oldstyle-nums','lining-nums','tabular-nums','proportional-nums')或字符串 | [] |
letterSpacing
增加或减少字符之间的间距。默认情况下,没有额外的字母间距。
lineHeight
数值,用于控制文本元素内文本行之间的垂直间距。它指定了文本连续行基线之间的距离。
textAlign
指定文本对齐方式。在 Android 上,仅在 Oreo(8.0)或更高版本(API 级别 >= 26)上支持 'justify' 值。在较低的 Android 版本上,该值将回退到 left。
| 类型 | 默认 |
|---|
枚举('auto','left','right','center','justify') | 'auto' |
textAlignVertical
Android
| 类型 | 默认 |
|---|
枚举('auto','top','bottom','center') | 'auto' |
textDecorationColor
iOS
textDecorationLine
| 类型 | 默认 |
|---|
枚举('none','underline','line-through','underline line-through') | 'none' |
textDecorationStyle
iOS
| 类型 | 默认 |
|---|
枚举('solid','double','dotted','dashed') | 'solid' |
textShadowColor
textShadowOffset
| 类型 |
|---|
对象:{width?: number, height?: number} |
textShadowRadius
textTransform
| 类型 | 默认 |
|---|
枚举('none','uppercase','lowercase','capitalize') | 'none' |
verticalAlign
Android
| 类型 | 默认 |
|---|
枚举('auto','top','bottom','middle') | 'auto' |
writingDirection
iOS
| 类型 | 默认 |
|---|
枚举('auto','ltr','rtl') | 'auto' |
userSelect
它允许用户选择文本并使用本机复制和粘贴功能。优先于 selectable prop。
| 类型 | 默认 |
|---|
枚举('auto','text','none','contain','all') | 无 |