Muh*_*man 3 javascript react-native react-native-elements
实际上,我正在使用 react-native-element 设计语言。当我过去实现复选框时,它的行为就像我不想要的可触摸不透明度。
<CheckBox
containerStyle={{ backgroundColor: "transparent", borderWidth: 0 }}
center
size={14}
title="vegetarian"
textStyle={{
fontSize: theme.FONT_SIZE_X_SMALL,
fontWeight: theme.FONT_WEIGHT_LIGHT
}}
checkedColor="red"
checked={this.state.checked}
onPress={() => this.setState({ checked: !this.state.checked })}
/>;
Run Code Online (Sandbox Code Playgroud)
您可以传递一个Component道具(TouchableOpacity默认情况下),TouchableWithoutFeedback例如作为值。
<CheckBox
Component={TouchableWithoutFeedback}
containerStyle={{ backgroundColor: "transparent", borderWidth: 0 }}
center
size={14}
title="vegetarian"
textStyle={{
fontSize: theme.FONT_SIZE_X_SMALL,
fontWeight: theme.FONT_WEIGHT_LIGHT
}}
checkedColor="red"
checked={this.state.checked}
onPress={() => this.setState({ checked: !this.state.checked })}
/>;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3052 次 |
| 最近记录: |