Diagonal line-through Text React-Native

Viewed 2873

I am looking for a way to make a diagonal line through a text element on react-native.

with an :after element and css this should be possible but this is not available in react-native.

Anybody cool suggestions?

3 Answers

Eventually, I went for a situation where I drew an absolute positioned line with a rotation on it.

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

if you want to make strick in text you should use something like this

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

You can try this:

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