2010-08-17 57 views
0

我正在實現給孩子們申請我在加入陣列中實現微調categeory列出這些數組文本列表現在我實現這些文本數組列表繪製圖像替換微調如何實現顯示圖像作爲項目在轉

personalinformation = (Spinner) findViewById(R.id.SpinnerCategory); 
ArrayAdapter<?> adapterDefaultpersonal = ArrayAdapter.createFromResource(Animals.this,R.array.Animalinformation, android.R.layout.simple_spinner_item); 
adapterDefaultpersonal.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); 
personalinformation.setAdapter(adapterDefaultpersonal); 
personalinformation.setSelection(getSharedPreferences("", 0).getInt("SpinnerSelection", 0)); 
personalinformation.setOnItemSelectedListener(new OnItemSelectedListener() 
{ 
public void onItemSelected(AdapterView<?> parent,View v,int position,long id) 
{ 
if(position==0) 
{ 
}}); 

this is the spinner code i am using array of text list these text replaced to drawable items in to spinner how can implemented some solution i am new in android 

回答

0

如果我正確理解你的問題,你想讓微調器顯示圖標而不是文本。 然後,您需要擴展您的ArrayAdapter來覆蓋getView()以代替返回imageView。
查看更多信息,請登錄this tutorial