我使用React Native Base我的iPad應用程序,我把兩個Col
組件的Grid
組件這樣的內部:柱內網需要半寬度反應本土基地
<Container style={styles.container}>
<Header style={styles.header}>
<Body>
<Title>Header</Title>
</Body>
</Header>
<Content style={styles.mainContent}>
<Grid>
<Col style={styles.leftContent}>
</Col>
<Col style={styles.rightContent}>
</Col>
</Grid>
</Content>
</Container>
我的樣式表是這樣的:
const styles = StyleSheet.create({
container: {
backgroundColor: '#ccc'
},
mainContent: {
marginTop: 10,
},
header: {
backgroundColor: '#fff'
},
leftContent: {
width: 340,
height: 686,
backgroundColor: "green",
marginLeft: 5,
},
rightContent: {
width: 614,
height: 686,
backgroundColor: "yellow",
marginLeft: 10,
marginRight: 5,
},
兩個Col
都採取幾乎相等的寬度不是給定的寬度。我應該如何讓這些組件採取給定的寬度?
你試過使用flex嗎? –