Title: React-native picker selector tags:

  • The selector
  • react-native-picker
  • picker

React-native picker selector description

  • This is a multi-level selector

The installation

 npm install react-native-picker --save

Copy the code
/ / select city pickerShow = () = > {let data = {a: [{a1: [1, 2, 3, 4],}, {a2: [5, 6, 7, 8],}, {a3: [9, 10, 11, 12], }, ], }, { b: [ { b1: [11, 22, 33, 44], }, { b2: [55, 66, 77, 88], }, { b3: [99, 1010, 1111, 1212], }, ], }, { c: [ { c1: ['a', 'b', 'c'], }, { c2: ['aa', 'bb', 'cc'], }, { c3: ['aaa', 'bbb', 'ccc'], }, ], }, ]; Picker.init({pickerConfirmBtnText: 'confirm ', pickerCancelBtnText:' cancel ', pickerTitleText: 'select ', pickerData: CitysJson, // selectedValue: [59], onPickerConfirm: (data) => { console.log(data); }, onPickerCancel: (data) => { console.log(data); }, onPickerSelect: (data) => { console.log(data); }}); Picker.show(); };Copy the code