我在项目中使用了微调器,但看起来像是
但我希望微调器作为实际的下拉列表。请帮助我。
像这样
答案 0 :(得分:0)
city_array = new String[]{city1, city2, city3,....};
ArrayAdapter<String> cityArrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item,city_array);
cityArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
city_spinner = (Spinner) findViewById(yourSpinner);
city_spinner.setAdapter(cityArrayAdapter);