2010-08-17 56 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