Solution 1 :
- Change the hard-coded value of the Spinner width to
wrap_content
- add the below theme to the spinner
So, your spinner :
<Spinner
android_id="@+id/directory_list"
android_layout_width="wrap_content"
android_layout_height="?actionBarSize"
android_theme="@android:style/Theme.Holo.Light.DarkActionBar"
android_spinnerMode="dropdown" />
Problem :
I want to remove padding between text and icon,
iattach image below
This is layout code
<LinearLayout
android_layout_width="fill_parent"
android_orientation="horizontal"
android_layout_height="?actionBarSize">
<ImageButton
android_id="@+id/bt_close"
android_background="?selectableItemBackgroundBorderless"
android_layout_width="?actionBarSize"
android_layout_height="?actionBarSize"
android_tint="@color/grey_60"
app_srcCompat="@drawable/ic_chevron_left"/>
<Spinner
android_layout_width="150dp"
android_layout_height="?actionBarSize"
android_spinnerMode="dropdown"
android_id="@+id/directory_list"
/>
<View
android_layout_width="0dp"
android_layout_height="0dp"
android_layout_weight="1.0"
/>
<ImageButton
android_background="?selectableItemBackgroundBorderless"
android_layout_width="?actionBarSize"
android_layout_height="?actionBarSize"
android_tint="@color/grey_60"
app_srcCompat="@drawable/ic_done"
android_id="@+id/done"
/>
</LinearLayout>
i can’t figure out
P.S
I search in stackoverflow about this but no one working, so i decided to ask a question here,
Thank you
Comments
Comment posted by HameedR
its not working i tried wrap_content , its giving larger than previous
Comment posted by Zain
@HameedR I just updated the answer .. try to add this theme