【发布时间】:2019-12-28 18:40:17
【问题描述】:
我有一个水平滚动视图
在这个 ScrollView 中,我想显示多个 全高和全宽 视图。
我不知道如何将每个 View 的宽度设置为 100%。
实际上就像它们有一个“自动”宽度(大约 70%)
<SafeAreaView style={styles.container}>
<ScrollView
style={styles.info}
horizontal={true}
>
{this.state.list.map(item => (
<View style={styles.item}>...</View>
))}
</ScrollView>
</SafeAreaView>
还有样式
info: {
width: "100%",
height: "100%",
display: "flex"
},
item: { // props for the items in my views
display: "flex",
alignItems: "center",
justifyContent: "space-between",
height: "100%",
paddingTop: 30,
paddingBottom: 10
}
我尝试输入width : "100%",但它当然没有例外
谢谢
【问题讨论】:
标签: react-native view scrollview