答案 0 :(得分:1)
已经应用了Button(react-native-elements)的默认CSS,例如padding和margin。您必须使用您的CSS覆盖该CSS,然后应用flex和flexDirection来附加两个按钮。
尝试此代码
<View style={{flex: 1, flexDirection: 'row'}}>
<Button style={{marginRight: 0}} title="Button 1" />
<Button style={{marginLeft: 0}} title="Button 2" />
</View>
答案 1 :(得分:0)
使用flexDirection附加两个。
<View style={{ flex: 1, flexDirection: "row" }}>
<Button title="Button 1" />
<Button title="Button 2" />
</View>
答案 2 :(得分:0)
<View style={{flex:1}}>
<View style={{ flexDirection: "row"}}>
<View style={{flexGrow: 1, flexBasis: 1}}>
<Button title="one" />
</View>
<View style={{flexGrow: 1, flexBasis: 1}}>
<Button title="two" />
</View>
</View>