React-Native:Text的属性和样式

属性

1. numberOfLines 文本行数限制,添加后超过限制行数文本会在末尾默认以...的形式省略。

2. ellipsizeMode 设置文本缩略格式,配合numberOfLines使用,values:

tail:在末尾...省略(默认值)

clip:在末尾切割,直接切割字符无省略符

head:在前面...省略

middle:在中间...省略

3. onPress 点击事件

4. style 样式

样式

1. color 字体颜色

2. fontSize 字体大小

3. fontFamily 字体

4. fontStyle 字的样式  (normal:正常italic:斜体)

5. fontWeight 设置粗体(normal:正常bold:粗体100,200,300, 400, 500, 600, 700, 800, 900)

6.lineHeight 行高

7.textAlign 文字对其方式(auto:自动对齐left:左对齐right:右对齐 center:居中对齐)

8: textDecorationLine 下划线和删除线样式(none:无线underline:下划线line-through:删除线 underline line-through:下划线和删除线)

textAlign 文字对其方式(auto:自动对齐left:左对齐right:右对齐 center:居中对齐)

原文地址:https://www.cnblogs.com/cui-cui/p/8984597.html