react-native-checkboxlist
一个跨平台(iOS和Android)单和多项选择React Native组件。此组件基于react-native-multiple-choice
安装
npm install react-native-checkboxlist --save
使用
这里是组件使用的概述。
import CheckboxList from 'react-native-checkboxlist'
使用示例1
<CheckboxList = = = =/>
使用示例2
分别设置值和显示文字
<CheckboxList = = =/>
属性
style - {}
custom style of the listoptionStyle - {}
custom style of the option elementoptions - []
required array of optionsselectedOptions - []
optional array of initially selected optionsmaxSelectedOptions - int
optional maximum number of selectable optionsonSelection - function(option){}
option selection callbackrenderIndicator - function(option)
should return a selected/deselected indicator node, default: check mark imagerenderSeparator - function(option)
should return a separator node that is displayed between the options, default: gray linerenderText - function(option)
should return a text node, default: text noderenderRow - function(option)
should return a option viewdisabled - bool
if set to true component is disabled and can't be interacted with
截图
示例1
示例2