RN View borderStyle只设置一边的Width无法显示

<View style={{height:computedRem(0.04),overflow:"hidden",marginVertical:computedRem(0.25)}}>
	<View style={{
		borderColor:"#CACACA",
		borderWidth:computedRem(0.04),
		borderStyle:"dotted",
		height:0,
		borderRadius:0.1
		}}>
	</View>
</View>

注意点:

  1. 遮盖隐藏,内外高度应该等于一条边的width
  2. 内部的border需全部设置,只设置一边出不了效果,所以使用遮盖隐藏
  3. computedRem是我的转换尺寸函数,测试代码时可以更换成数字

你可能感兴趣的:(RN)