【发布时间】:2016-09-03 20:32:14
【问题描述】:
我正在尝试在如下所示的绿色方块上放置一个白点。
但无论我如何尝试,我仍然得到这个。白点的背景颜色和边距消失了。
这是代码。
<View style={backgroundColor: 'white', zIndex: 1, margin: 2, borderRadius: 10, borderWidth: 2} >
<View style={backgroundColor: 'green', zIndex: 0} />
</View>
我虽然 zIndex 会解决我的问题,但它没有。我也尝试过交换订单,但它只给了我一个纯绿色的正方形。帮忙?
<View style={backgroundColor: 'green', zIndex: 0}>
<View style={backgroundColor: 'white', zIndex: 1, margin: 2, borderRadius: 10, borderWidth: 2} />
</View>
【问题讨论】:
标签: reactjs react-native flexbox