1

Kindly help me I am facing the problem in spinner,i created the spinner . the adapter having only an Imageview. I have added the spinner on Linearlayout which is in Toolbar Layout.

when i creating the view, in Spinner ,the Space between Imageview and arrow. how to get rid of this space. i have added the Images below. check that image and kindly help me to solve this problem.

the Toolbar layout is below.

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout   
   xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:app="http://schemas.android.com/apk/res-auto"
   xmlns:tools="http://schemas.android.com/tools"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:fitsSystemWindows="true"
   tools:context=".fragmentbase.Activity_Home">

  <android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/AppTheme.AppBarOverlay"
    app:elevation="0dp">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/AppTheme.PopupOverlay">
        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="center|right">
            <android.support.v7.widget.SearchView
                android:id="@+id/action_search"
                style="@style/searchviewTheme"
                android:layout_width="wrap_content"
                android:layout_height="match_parent" />

            <Spinner
                android:id="@+id/spnrChildChange"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:dropDownWidth="wrap_content"
                android:spinnerMode="dropdown"/>

        </LinearLayout>



    </android.support.v7.widget.Toolbar>

</android.support.design.widget.AppBarLayout>

<include
    android:id="@+id/layout_dash_child"
    layout="@layout/content_main" />


</android.support.design.widget.CoordinatorLayout>

When i set to Spinner layout_width="65" the image hide behind the arrow

When i set to layout_width="65" the image hide behind the arrow

When i set to Spinner layout_width="wrap_content", the Space appears between circle imageview and arrow of the spinner.

When i set to Spinner layout_width="wrap_content", the Space appears between circle imageview and arrow of the spinner.

and below is the Spinner Item, which is an Imageview,

<?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:id="@+id/lnrChildChange"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:background="#2570F9">


   <de.hdodenhof.circleimageview.CircleImageView
       android:id="@+id/imgChildChange"
       android:layout_width="@dimen/profile_img"
       android:layout_height="@dimen/profile_img"
       android:layout_margin="@dimen/most_most_min_margin"
       style="?android:attr/spinnerItemStyle"
       android:src="@drawable/place_user"
       app:civ_border_color="#ffffff"
       app:civ_border_width="1dp" />


 </LinearLayout>

I have tested with MI Max,Samsung j5 and Oppo f1s. Oppo f1s no problem. where as rest of the devices facing the problem.

Sev
  • 19
  • 9
  • 2
    use this 'http://stackoverflow.com/questions/23609291/how-to-add-left-drawable-in-spinner-view-in-android' – AKASH WANGALWAR Nov 11 '16 at 11:21
  • Helped me. i upvoted your suggestion – Sev Nov 11 '16 at 11:41
  • 1
    visit [link](http://stackoverflow.com/questions/34322156/how-to-move-the-android-spinner-drop-down-arrow-closer-to-its-emitting-text) – Shweta Chauhan Nov 12 '16 at 08:58
  • See my answer http://stackoverflow.com/questions/41013678/how-to-create-android-spinner-without-down-triangle-on-the-right-side-of-the-wid/41014223#41014223 – Noorul Dec 19 '16 at 17:28

0 Answers0