I tried to set spinner with drop down arrow but i couldn\'t fix it can anyone help me with this? I have attached the source code.
my class file:
From the API level 16 and above, you can use following code to change the drop down icon in spinner. just goto onItemSelected in setonItemSelectedListener and change the drawable of textview selected like this.
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView> parent, View view, int position, long id) {
// give the color which ever you want to give to spinner item in this line of code
//API Level 16 and above only.
((TextView)parent.getChildAt(position)).setCompoundDrawablesRelativeWithIntrinsicBounds(null,null,ContextCompat.getDrawable(Activity.this,R.drawable.icon),null);
//Basically itis changing the drawable of textview, we have change the textview left drawable.
}
@Override
public void onNothingSelected(AdapterView> parent) {
}
});
hope it will help somebody.