Text スタイルプロパティ
使用例
- TypeScript
- JavaScript
リファレンス
Props
color
型 |
---|
color |
fontFamily
型 |
---|
string |
fontSize
型 |
---|
number |
fontStyle
型 |
---|
enum('normal' , 'italic' ) |
fontWeight
フォントの太さを指定します。ほとんどのフォントで'normal'
と'bold'
の値がサポートされています。すべてのフォントが各数値値のバリアントを持っているわけではなく、その場合は最も近いものが選択されます。
型 | デフォルト |
---|---|
enum('normal' , 'bold' , '100' , '200' , '300' , '400' , '500' , '600' , '700' , '800' , '900' ) または number | 'normal' |
includeFontPadding
Android
特定のアセンダ/ディセンダのためのスペースを確保するための余分なフォントパディングを削除するには、false
に設定します。一部のフォントでは、このパディングにより、垂直方向に中央揃えされたときにテキストがわずかにずれて見えることがあります。最良の結果を得るには、textAlignVertical
もcenter
に設定してください。
型 | デフォルト |
---|---|
bool | true |
fontVariant
フォントのすべてのフォントバリアントを設定できます。列挙型配列またはスペース区切りの文字列(例:'small-caps common-ligatures'
)を使用して設定できます。
型 | デフォルト |
---|---|
enum('small-caps' , 'oldstyle-nums' , 'lining-nums' , 'tabular-nums' , 'proportional-nums' ) の配列、または文字列 | [] |
letterSpacing
文字間の間隔を増減します。デフォルトでは、余分な文字間隔はありません。
型 |
---|
number |
lineHeight
テキスト要素内のテキスト行間の垂直方向の間隔を制御する数値。連続するテキスト行のベースライン間の距離を指定します。
型 |
---|
number |
textAlign
テキストの配置を指定します。Androidでは、'justify' の値はOreo (8.0) 以降 (APIレベル >= 26) でのみサポートされています。それより古いAndroidバージョンでは、値はleft
にフォールバックします。
型 | デフォルト |
---|---|
enum('auto' , 'left' , 'right' , 'center' , 'justify' ) | 'auto' |
textAlignVertical
Android
型 | デフォルト |
---|---|
enum('auto' , 'top' , 'bottom' , 'center' ) | 'auto' |
textDecorationColor
iOS
型 |
---|
color |
textDecorationLine
型 | デフォルト |
---|---|
enum('none' , 'underline' , 'line-through' , 'underline line-through' ) | 'none' |
textDecorationStyle
iOS
型 | デフォルト |
---|---|
enum('solid' , 'double' , 'dotted' , 'dashed' ) | 'solid' |
textShadowColor
型 |
---|
color |
textShadowOffset
型 |
---|
オブジェクト: {width?: number, height?: number} |
textShadowRadius
型 |
---|
number |
textTransform
型 | デフォルト |
---|---|
enum('none' , 'uppercase' , 'lowercase' , 'capitalize' ) | 'none' |
verticalAlign
Android
型 | デフォルト |
---|---|
enum('auto' , 'top' , 'bottom' , 'middle' ) | 'auto' |
writingDirection
iOS
型 | デフォルト |
---|---|
enum('auto' , 'ltr' , 'rtl' ) | 'auto' |
userSelect
ユーザーがテキストを選択し、ネイティブのコピー&ペースト機能を使用できるようにします。selectable
プロパティよりも優先されます。
型 | デフォルト |
---|---|
enum('auto' , 'text' , 'none' , 'contain' , 'all' ) | none |