【发布时间】:2018-07-27 19:30:27
【问题描述】:
我想要的是在多个其他视图之上显示一行(或一个视图)。
我已经尝试使用position: absolute、z-index 并将我想要的东西写在代码的最后。不幸的是,这些都不起作用。我怎样才能把这条线放在首位?
这是我得到的:
这是代码:
<ScrollView style={styles.container}>
<View style={styles.items}>
{this.state.items.map((item, index) =>
<View style={styles.item} key={index} elevation={3} />
}
</View>
<View style={styles.line} />
</ScrollView>
const styles = StyleSheet.create({
container: {
flex: 1
},
row: {
margin: 10
},
line: {
backgroundColor: 'blue',
position: 'absolute',
top: 0,
bottom: 0,
left: 80,
width: 7,
}
【问题讨论】:
标签: css reactjs react-native css-position