react-native-picker选择器

  • Post author:
  • Post category:其他


select下拉框的实现

import Picker from 'react-native-picker';

renderPicker(){
   Picker.init({
    pickerData: [1,2.3],
    selectedValue: [1],
    pickerConfirmBtnText:'确定',
    pickerCancelBtnText:'取消',
    pickerTitleText:'请选择省份',
    onPickerConfirm: data => {
        console.log(data,"选择结果");
    },
    onPickerCancel: data => {
        console.log(data,"取消");
    },
    onPickerSelect: data => {
        console.log(data,"选择");
    }
   });
   Picker.show();
}




版权声明:本文为shizhihua11原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。