【发布时间】:2017-07-14 18:05:45
【问题描述】:
我正在使用 React 创建一个 iOS 应用程序。
我有两个按钮:
<View style={{flexDirection: 'row', alignItems: 'center'}}>
<Button title="Overview" onPress={() => {this.setState({detailsMode: false})}} style={{backgroundColor: '#666'}}/>
<Button title="Detailed" onPress={() => {this.setState({detailsMode: true})}} style={{}}/>
</View>
它们看起来像这样:
我希望它们看起来像这样:
我试过了,但失败得很惨:
<View style={{flex: 1, borderRadius: 10, borderWidth: 0, borderColor: '#A087D1', backgrounColor: 'white', flexDirection: 'row', alignItems: 'center'}}>
<Button style={{ borderTopLeftRadius: 10, borderTopRightRadius: 10}} title="Overview" onPress={() => {this.setState({detailsMode: false})}} style={{backgroundColor: '#666'}}/>
<Button style={{ borderTopLeftRadius: 10, borderTopRightRadius: 10}} title="Detailed" onPress={() => {this.setState({detailsMode: true})}} style={{}}/>
</View>
你能帮帮我吗?
【问题讨论】:
-
React Native 是一种使用 React 为 iOS/Android 创建原生移动应用程序的方法。这是你问题的背景吗?
-
@SumnerEvans 我是新手。但我正在使用 react native 构建一个 IOS 应用程序。我标记正确了吗?
-
您已正确标记此内容。
-
@SumnerEvans 谢谢
标签: javascript html css reactjs react-native