React Native 的复选框组件 React Native Check Box
- 授权协议: MIT
- 开发语言: JavaScript
- 操作系统: Android
- 软件首页: https://github.com/crazycodeboy/react-native-check-box
- 软件文档: https://github.com/crazycodeboy/react-native-check-box/blob/master/README.md
- 官方下载: https://github.com/crazycodeboy/react-native-check-box/archive/master.zip
软件介绍
React Native Check Box,这是一款方便易用的Check Box组件,支持 Android 和 iOS。
安装:
npm i react-native-check-box --save import CheckBox from 'react-native-check-box'
运行效果:
基本用法:
<CheckBox
style={{flex: 1, padding: 10}}
onClick={()=>this.onClick(data)}
isChecked={data.checked}
leftText={leftText} />;自定义复选框:
renderCheckBox(data) {
var leftText = data.name;
return (
<CheckBox
style={{flex: 1, padding: 10}}
onClick={()=>this.onClick(data)}
isChecked={data.checked}
leftText={leftText}
checkedImage={<Image source={require('../../page/my/img/ic_check_box.png')} style={this.props.theme.styles.tabBarSelectedIcon}/>}
unCheckedImage={<Image source={require('../../page/my/img/ic_check_box_outline_blank.png')} style={this.props.theme.styles.tabBarSelectedIcon}/>}
/>);
}
