I'd like to decrease/change the spinner size which includes:
Code is as follows: Spinner spinner = new Spinner(this); ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(this, android. R. layout.
You can change these settings in the layout file. The hello-spinner tutorial is very useful.
http://developer.android.com/guide/tutorials/views/hello-spinner.html
Add a new XML file to your layout folder.
Example: spinnerLayout.xml
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/spinnerTarget"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="14pt"
android:textColor="#FF8B1500"
android:gravity="center"/>
Change the adapter resource to your new layout file:
adapter = ArrayAdapter.createFromResource(
this, R.array.sound, R.layout.spinnerLayout);
android:padding="0dip"
in my spinner makes it smaller using
android.R.layout.simple_spinner_item
when making the array adapter seems to make it smaller also, but i have no idea whether or not that is a sane thing to do.
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