How can I make the spinner width same as largest available item width

You should be able to get the effect you want by specifying the width of the dropdown as WRAP_CONTENT:

<Spinner
    android:id="@+id/spinner1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="10dp"
    android:dropDownWidth="wrap_content"
    android:spinnerMode="dropdown" />

This will measure up to 15 items in the spinner’s adapter to determine the width it should use.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)