【发布时间】:2018-03-14 01:45:36
【问题描述】:
有没有办法使用“视图”使其循环? 我已经尝试过使用:
function generateListViewPager (shapeStyle) {
return () => {
return (
<View style={styles.pageContainer} >
<ScrollView showsVerticalScrollIndicator={false}>
for(let i = 0; i < 40; i++){
<View style={[styles.shapeBase]}>
<Image
style={{width: windowWidth, height: 260, alignItems: 'center'}}
source={{uri: 'https://test.com/img/i.jpg'}}
/>
<View style={{
position: 'absolute',
width: windowWidth - 15,
height: 130,
bottom: 41,
backgroundColor: 'rgba(0, 0, 0, 0.1)'
}}>
<Text style={styles.TitleStyle}>Test i</Text>
</View>
<View style={styles.subButton}>
</View>
<View style={styles.hairline} />
<View style={styles.subContent}>
</View>
</View>
}
</ScrollView>
</View>
)
}
}
我需要从 0 到 39 显示我的视图,我将如何使用循环来实现?谢谢
【问题讨论】:
标签: android ios react-native mobile