【React Native】文件翻譯閱讀紀錄 - APIs - Text Style Props
![]() |
| Facebook Open Source React Native |
Props
textShadowOffsetcolorfontSizefontStylefontWeightlineHeighttextAligntextDecorationLinetextShadowColorfontFamilytextShadowRadiusincludeFontPaddingtextAlignVerticalfontVariantletterSpacingtextDecorationColortextDecorationStyletextTransformwritingDirection
參考
Props
textShadowOffset
| TYPE | REQUIRED |
|---|---|
| object: {width: number,height: number} | No |
color
| TYPE | REQUIRED |
|---|---|
| color | No |
fontSize
| TYPE | REQUIRED |
|---|---|
| number | No |
fontStyle
| TYPE | REQUIRED |
|---|---|
| enum('normal', 'italic') | No |
fontWeight
指定字體粗細。大多數字體都支持“正常”和“粗體”值。並非所有字體都具有每個數值的變體,在這種情況下,選擇最接近的字體。
| TYPE | REQUIRED |
|---|---|
| enum('normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900') | No |
lineHeight
| TYPE | REQUIRED |
|---|---|
| number | No |
textAlign
指定文本對齊。值'justify'僅在iOS上支持,在Android上支持後備。
| TYPE | REQUIRED |
|---|---|
| enum('auto', 'left', 'right', 'center', 'justify') | No |
textDecorationLine
| TYPE | REQUIRED |
|---|---|
| enum('none', 'underline', 'line-through', 'underline line-through') | No |
textShadowColor
| TYPE | REQUIRED |
|---|---|
| color | No |
fontFamily
| TYPE | REQUIRED |
|---|---|
| string | No |
textShadowRadius
| TYPE | REQUIRED |
|---|---|
| number | No |
includeFontPadding
設置為false以刪除旨在為某些上升/下降器騰出空間的額外字體填充。對於某些字體,此填充可以使文本在垂直居中時看起來略微錯位。為獲得最佳效果,還將textAlignVertical設置為居中。默認為true。
| TYPE | REQUIRED | PLATFORM |
|---|---|---|
| bool | No | Android |
textAlignVertical
| TYPE | REQUIRED | PLATFORM |
|---|---|---|
| enum('auto', 'top', 'bottom', 'center') | No | Android |
fontVariant
| TYPE | REQUIRED | PLATFORM |
|---|---|---|
| array of enum('small-caps', 'oldstyle-nums', 'lining-nums', 'tabular-nums', 'proportional-nums') | No | iOS |
letterSpacing
| TYPE | REQUIRED | PLATFORM |
|---|---|---|
| number | No | iOS |
textDecorationColor
| TYPE | REQUIRED | PLATFORM |
|---|---|---|
| color | No | iOS |
textDecorationStyle
| TYPE | REQUIRED | PLATFORM |
|---|---|---|
| enum('solid', 'double', 'dotted', 'dashed') | No | iOS |
textTransform
| TYPE | REQUIRED | PLATFORM |
|---|---|---|
| enum('none', 'uppercase', 'lowercase', 'capitalize') | No | iOS |
writingDirection
| TYPE | REQUIRED | PLATFORM |
|---|---|---|
| enum('auto', 'ltr', 'rtl') | No | iOS |

0 意見