【发布时间】:2018-11-28 05:09:14
【问题描述】:
所以我只是在学习....在 react-native 中构建一个测验应用程序,我认为第一行按钮和第二行按钮之间的空间太大,我该如何减少它? 谢谢
<LinearGradient colors={['#0D0B18','#28263E']} style={styles.container}>
<Text style={styles.question}>After Jesus rose from the dead, how long did he remain on earth before ascending to heaven? </Text>
<View style={styles.buttonRow}>
<TouchableOpacity style={styles.buttonStyle} onPress={this.onPress}>
<Text style={styles.buttonText}>12 days</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.buttonStyle} onPress={this.onPress}>
<Text style={styles.buttonText}>40 days</Text>
</TouchableOpacity>
</View>
<View style={styles.buttonRow}>
<TouchableOpacity style={styles.buttonStyle}onPress={this.onPress}>
<Text style={styles.buttonText}>3 months</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.buttonStyle} onPress={this.onPress}>
<Text style={styles.buttonText}>1 year</Text>
</TouchableOpacity>
</View>
<View style={styles.progressStyle}>
<ProgressViewIOS
style={styles.progressView}
progress={(0.2)}
/>
</View>
</LinearGradient>
const styles = StyleSheet.create ({
container: {
flex: 3,
},
question: {
paddingTop: '20%',
padding: 30,
flex: 1,
color: '#fff',
fontSize: 25
},
buttonRow : {
marginTop: 0,
flexDirection: 'row',
color: '#fff',
alignItems: 'center',
justifyContent: 'space-evenly',
},
buttonStyle: {
backgroundColor: '#fff',
width: '40%',
height: '50%',
justifyContent: 'center',
alignItems: 'center',
borderRadius: 10
},
buttonText: {
color: '#000'
},
progressView: {
width: '90%',
},
progressStyle: {
padding: 20,
alignItems: 'center',
justifyContent: 'center',
}
});
【问题讨论】:
标签: css reactjs react-native