我正在尝试为应用程序制作一个注册页面。我想放置一个复选框来接受条款和条件,但我不知道如何将复选框稍微放在文本的左侧。目前,它被放在文本的第一个字母上
<View style={{flexDirection: 'row', alignItems: 'center'}>
<CheckBox style =checked={this.state.agreeTNCs} onPress={() => this.setState({agreeTNCs: !this.state.agreeTNCs})} testID="tncsBox"/>
<Hyperlink linkStyle={{color: '#2980b9'}} onPress={() => this.props.screenChangeHandler(routes.loggedOut.termsAndConditions)}>
<Text>I agree to the Nowzi Terms and Conditions</Text>
</Hyperlink>
</View>
最佳答案
尝试在两者之间添加不间断空格:
<View style={{flexDirection: 'row', alignItems: 'center'}>
<CheckBox style =checked={this.state.agreeTNCs} onPress={() => this.setState({agreeTNCs: !this.state.agreeTNCs})} testID="tncsBox"/>
<Hyperlink linkStyle={{color: '#2980b9'}} onPress={() => this.props.screenChangeHandler(routes.loggedOut.termsAndConditions)}>
<Text>I agree to the Nowzi Terms and Conditions</Text>
</Hyperlink>
</View>
关于javascript - React Native 风格复选框和文本分隔,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47720656/