【问题标题】:Draw vertical dotted line in react native在本机反应中绘制垂直虚线
【发布时间】:2020-03-02 20:40:55
【问题描述】:

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

【问题讨论】:

标签: javascript css reactjs react-native layout


【解决方案1】:

首先,如果您想要更多样式,可以搜索第三个库。我找到了react-native-dash 库。你可以像下面这样使用:

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

那么,如果你想自己定义一个组件,你可以使用样式,并将其放入 纯成分

export const DotLine = (props) => {

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

   })

}

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-09-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-23
    相关资源
    最近更新 更多