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 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.