React native 文本中的对角线

React native 文本中的对角线,react-native,React Native,我正在寻找一种通过react native上的文本元素生成对角线的方法 对于:after元素和css,这应该是可能的,但在react native中不可用 有人提出很酷的建议吗?如果你想在文本中添加strick,你应该使用这样的建议 <Text style={{ textDecorationLine: 'line-through' }}>$12</Text> 12美元 最终,我选择了一种情况,在这种情况下,我画了一条带旋转的绝对定位线 <View

我正在寻找一种通过react native上的文本元素生成对角线的方法

对于:after元素和css,这应该是可能的,但在react native中不可用


有人提出很酷的建议吗?

如果你想在文本中添加strick,你应该使用这样的建议

<Text style={{ textDecorationLine: 'line-through' }}>$12</Text>
12美元

最终,我选择了一种情况,在这种情况下,我画了一条带旋转的绝对定位线

<View
                style={{
                    position: 'absolute',
                    transform: [ {rotate: '17deg'} ],
                    top: 7,
                    width: 25,
                    height: 1,
                    borderBottomColor: styleGuide.errorColorRed,
                    borderBottomWidth: 1,
                }}/>

您可以尝试以下方法:

style={{ textDecorationLine: 'line-through' }}

你也可以使用这两个道具textDecorationColor:color(iOS)textDecorationStyle:enum('solid'、'double'、'double'、'double'、'double'、'虚线')(iOS)当然,但这将使它成为一条水平线。我正在寻找一种方法,使对角线通过。无论如何谢谢你。