小编cmc*_*des的帖子

按钮的宽度在本机反应中没有改变

我有两个按钮排成一排,间隔为 20,它们占据了按钮标题所需的宽度。它们的宽度没有改变!

按钮代码

<View style={styles.buttonContainer}>

  <View style={{ paddingLeft: 20 }}>
    <Button title={tick} style={styles.button} onPress color="tomato" />
  </View>

  <View style={{ paddingLeft: 20 }}>
    <Button title="X" style={styles.button} onPress color="tomato" />
  </View>

</View>
Run Code Online (Sandbox Code Playgroud)

按钮的 CSS

buttonContainer: {
    flex: 1,
    flexDirection: 'row',
    justifyContent: 'flex-end'
},
button: {
    width: 50, // no matter what value I set here, their width doesn't changes
    height: 20,
},
Run Code Online (Sandbox Code Playgroud)

javascript css android reactjs react-native

1
推荐指数
1
解决办法
5769
查看次数

标签 统计

android ×1

css ×1

javascript ×1

react-native ×1

reactjs ×1