Closed MarnoDev closed 8 years ago
我怎么才能只显示两个选项呢? OptionsPickerView pvGenderOption = new OptionsPickerView(mContext); ArrayList<String> genderStr = new ArrayList<>(); genderStr.add("male"); genderStr.add("female"); pvGenderOption.setCyclic(false, true, true); pvGenderOption.setPicker(genderStr); pvGenderOption.setSelectOptions(1); pvGenderOption.setOnoptionsSelectListener((options1, option2, options3) -> { String s = genderStr.get(options1); mTvGender.setText(s); }); pvGenderOption.show();
OptionsPickerView pvGenderOption = new OptionsPickerView(mContext); ArrayList<String> genderStr = new ArrayList<>(); genderStr.add("male"); genderStr.add("female"); pvGenderOption.setCyclic(false, true, true); pvGenderOption.setPicker(genderStr); pvGenderOption.setSelectOptions(1); pvGenderOption.setOnoptionsSelectListener((options1, option2, options3) -> { String s = genderStr.get(options1); mTvGender.setText(s); }); pvGenderOption.show();
You should see source code first(How three selection works),then you can see how to show two selection.
我怎么才能只显示两个选项呢?
OptionsPickerView pvGenderOption = new OptionsPickerView(mContext); ArrayList<String> genderStr = new ArrayList<>(); genderStr.add("male"); genderStr.add("female"); pvGenderOption.setCyclic(false, true, true); pvGenderOption.setPicker(genderStr); pvGenderOption.setSelectOptions(1); pvGenderOption.setOnoptionsSelectListener((options1, option2, options3) -> { String s = genderStr.get(options1); mTvGender.setText(s); }); pvGenderOption.show();