Using NumberPicker Widget with Strings

后端 未结 5 438
情歌与酒
情歌与酒 2020-11-30 18:58

Is there a way to use the Android NumberPicker widget for choosing strings instead of integers?

5条回答
  •  情话喂你
    2020-11-30 19:46

    NumberPicker picker = new NumberPicker(this);
    picker.setMinValue(0);
    picker.setMaxValue(2);
    picker.setDisplayedValues( new String[] { "Belgium", "France", "United Kingdom" } );
    

提交回复
热议问题