标签:
1 ArrayAdapter<CharSequence> timeArray = null; 2 timeArray=ArrayAdapter.createFromResource(this, R.array.playing_time_setting, android.R.layout.simple_spinner_item); 3 // timeArray=new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,timeString); //两种不同的方法 4 timeArray.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //参数为android提供的简单下拉式view布局 5 timeSetting.setAdapter(timeArray);
setOnItemSelectedListener(new Spinner.OnItemSelectedListener() { public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) { } public void onNothingSelected(AdapterView<?> arg0) { } });
标签:
原文地址:http://www.cnblogs.com/leomoli/p/4285826.html