欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

react-native 文本的下划线、删除线和虚线。

最编程 2024-07-09 17:47:17
...

textDecorationLine('none', 'underline', 'line-through'):横线位置
none:没有横线
underline:
// 横线 textDecorationLine:'underline'

效果:


underline

line-through:
// 横线 textDecorationLine:'line-through'

效果:


line-through

textDecorationStyle('solid', 'double', 'dotted', 'dashed'):线风格
solid
// 横线风格 textDecorationStyle:'solid'

效果:


solid

double
// 横线风格 textDecorationStyle:'double'

效果:


double

dotted
// 横线风格 textDecorationStyle:'dotted'

效果:


dotted

dashed
// 横线风格 textDecorationStyle:'dashed'

效果:


dashed

textDecorationColor:线的颜色
// 线的颜色 textDecorationColor:'black',

效果:


线的颜色

纯虚线 (目前只找到这种办法)
<Text style={{textDecorationLine:'line-through',textDecorationStyle:'dotted',color:'red' }}>- -</Text>