valuepicker = (NumberPicker) findViewById(R.id.valuepicker);
String[] city = {"city1","city2","city3","city3","city4","city4"};
valuepicker.setDisplayedValues(city);
valuepicker.setMinValue(0);
valuepicker.setMaxValue(city.length - 1);
valuepicker.setValue(4);
城市可以通过适配器提供吗? 怎么样?
答案 0 :(得分:0)
NumberPicker
扩展LinearLayout
,因此您无法使用Adapter
,但您可以为其显示一系列字符串,以setDisplayedValues
显示。< / p>