I have a spinnder and set its background color to white. The problem is, the arrow's gone. I don't know why. Is there something wrong?
I'm using this code.
drivers = (Spinner) findViewById(R.id.spinner1);
drivers.setBackgroundColor(Color.WHITE);
ArrayAdapter<String> adp1=new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item , driverList);
adp1.setDropDownViewResource(android.R.layout.select_dialog_singlechoice);
drivers.setAdapter(adp1);
drivers.setPrompt("Select Driver");
Here's my layout:
<Spinner
android:id="@+id/spinner1"
android:layout_width="330dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:ellipsize="marquee"/>
Any ideas? I want to retain the white background but the dropdown arrow should show.
I solved this problem wrapping spinner
by RelativeLayOut
and using background for RelativeLayOut
.Then arrow does not disappears.
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#f00" >
<Spinner
android:id="@+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With