项目作者: wayne214

项目描述 :
React-native版单多选的listview,适配IOS和Android
高级语言: JavaScript
项目地址: git://github.com/wayne214/react-native-wayne-checkboxlist.git
创建时间: 2017-08-10T07:09:58Z
项目社区:https://github.com/wayne214/react-native-wayne-checkboxlist

开源协议:Apache License 2.0

下载


react-native-wayne-checkboxlist

React-native版单多选的listview,适配IOS和Android
这是采用的ES6新语法写的,此组件基于react-native-checkoutbox

安装

  1. npm install react-native-wayne-checkboxlist --save

使用

这里是组件使用的概述。

  1. import CheckboxList from 'react-native-wayne-checkboxlist'

使用示例1

  1. <CheckboxList
  2. options={[
  3. 'Lorem ipsum dolor sit',
  4. 'Lorem ipsum',
  5. 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr',
  6. 'Lorem ipsum dolor sit amet, consetetur'
  7. ]}
  8. selectedOptions={['Lorem ipsum']}
  9. maxSelectedOptions={2}
  10. onSelection={(option)=>alert(option + ' was selected!')}
  11. />

属性

  • style - {} custom style of the list
  • optionStyle - {} custom style of the option element
  • options - [] required array of options
  • selectedOptions - [] optional array of initially selected options
  • maxSelectedOptions - int optional maximum number of selectable options
  • onSelection - function(option){} option selection callback
  • renderIndicator - function(option) should return a selected/deselected indicator node, default: check mark image
  • renderSeparator - function(option) should return a separator node that is displayed between the options, default: gray line
  • renderText - function(option) should return a text node, default: text node
  • renderRow - function(option) should return a option view
  • disabled - bool if set to true component is disabled and can’t be interacted with

截图

example