我试图使用ListItem
组件渲染一个简单的列表,但它似乎不起作用,我设置的只是一个空列表
代码:
const styles = StyleSheet.create({
container: {
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0,
justifyContent: 'flex-end',
alignItems: 'center'
}
}
details = [
'one',
'two',
'three'
]
return (
<View style={styles.container}>
<Modal
animationType="slide"
transparent={false}
visible={props.modalVisible}
onRequestClose={() => {
alert('Modal has been closed.');
}}>
<View style={styles.container}>
<View>
<Card containerStyle={{padding: 0}} >
{
details.map((i) => {
return (
<ListItem
key={i}
title={i}
/>
);
})
}
</Card>
</View>
</View>
</Modal>
</View>
);