在反应原生中绘制垂直虚线

Jas*_*nov 2 javascript css layout reactjs react-native

看图

谁能建议如何在 React Native 中的图标之间做这些垂直虚线?

Len*_*rod 7

首先,你可以搜索第三个库,如果你想要更多的风格。我找到react-native-dash图书馆。你可以像下面这样使用:

 <Dash dashGap={3} style={{width:1, height:100, flexDirection:'column',}}/>

Run Code Online (Sandbox Code Playgroud)

那么,如果你想自己定义一个组件,你可以使用样式,把它放在纯组件中

export const DotLine = (props) => {

  return({
     <View style={{
        borderStyle: 'dotted',
        height:200,
        borderLeftWidth:5
       }}/>

   })

}

//then use it in other components
<Icon/><DotLine/><Icon/>

Run Code Online (Sandbox Code Playgroud)