Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 选中复选框时对本机文本组件移动作出反应_React Native_Checkbox_Text - Fatal编程技术网

React native 选中复选框时对本机文本组件移动作出反应

React native 选中复选框时对本机文本组件移动作出反应,react-native,checkbox,text,React Native,Checkbox,Text,当选中此复选框时,相邻文本会随着复选框像素数的扩展而略微向右移动。鉴于“位置”属性在本机中的限制。它如何阻止这种情况发生 <View style={this.props.checkBoxWrapper}> <CheckBox title={''} checked={this.state.checkedNews} onPress={() => this.setState({ checkedNews:!this.state.checke

当选中此复选框时,相邻文本会随着复选框像素数的扩展而略微向右移动。鉴于“位置”属性在本机中的限制。它如何阻止这种情况发生

 <View style={this.props.checkBoxWrapper}>
    <CheckBox
     title={''}
     checked={this.state.checkedNews}
     onPress={() => this.setState({ checkedNews:!this.state.checkedNews })}
     containerStyle={this.props.checkboxContainerStyle}
     checkedColor='white'
     />
    <Text style={this.props.checkBoxTextStyle}>
    {I18n.t(this.props.labels.checkBoxNewsDialog)}
    </Text>
 </View>

this.setState({checkedNews:!this.state.checkedNews})}
containerStyle={this.props.checkboxContainerStyle}
checkedColor='white'
/>
{I18n.t(this.props.labels.checkBoxNewsDialog)}

假设您使用的是本机复选框,则不应出现这种情况,因为您的样式可能有问题。尝试删除
containerStyle
,以及什么是
checkedColor
prop?原生复选框元素没有任何这些道具