Adroid to modify spinner style

Asked

Viewed 1,373 times

0

Hello, follow my spinner inserir a descrição da imagem aquiinserir a descrição da imagem aqui

I’d like to leave it that way

Follows codes

Style.xml

<!-- Base application theme. -->
<style name="Theme.MyTheme" parent="Theme.AppCompat.NoActionBar">
    <!-- colorPrimary is used for the default action bar background -->
    <item name="colorPrimary">@color/colorPrimary</item>

    <!-- colorPrimaryDark is used for the status bar -->
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>

    <!-- colorAccent is used as the default value for colorControlActivated,
         which is used to tint widgets -->
    <item name="colorAccent">@color/colorAccent</item>

    <!-- You can also set colorControlNormal, colorControlActivated
         colorControlHighlight, and colorSwitchThumbNormal.-->
    <item name="colorControlNormal">@color/font</item>

</style>

<style name="Theme.MyThemeBottom" parent="Theme.MyTheme">
    <item name="colorPrimary">@android:color/white</item>

</style>

Spinner.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/branco"
tools:context=".com.ipeweb.toobar.Home">

<android.support.v7.widget.Toolbar
    android:id="@+id/tb_main"
    android:elevation="4dp"
    android:layout_height="?attr/actionBarSize"
    android:layout_width="match_parent"
    android:minHeight="?attr/actionBarSize"
    android:layout_alignParentLeft="true"
    android:background="?attr/colorPrimary"
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

<include
    android:id="@+id/inc_tb_bottom"
    layout="@layout/toolbar_bottom"/>

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:text="Agricultura Alves Queiroz"
    android:id="@+id/tvAlterarNome"
    android:textColor="@color/font"
    android:layout_below="@+id/tb_main"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_marginLeft="20dp"
    android:layout_marginStart="37dp"
    android:layout_marginTop="10dp" />

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Consultor: Aurora Souza"
    android:id="@+id/tvAlterarConsultor"
    android:textColor="@color/font"
    android:layout_below="@+id/tvAlterarNome"
    android:layout_alignLeft="@+id/tvAlterarNome"
    android:layout_alignStart="@+id/tvAlterarNome" />

<Spinner
    android:layout_width="340dp"
    android:layout_height="wrap_content"
    android:id="@+id/SPAtlerarResultado"
    android:textColor="@color/font"
    android:layout_below="@+id/tvAlterarConsultor"
    android:layout_alignLeft="@+id/tvAlterarConsultor"
    android:layout_alignStart="@+id/tvAlterarConsultor"
    android:layout_marginTop="26dp"
    android:popupBackground="@color/grey"
    android:divider="@drawable/list_divider"
    android:spinnerMode="dialog" />

  • Switch your spinner mode to android:spinnerMode="dropdown"/> @Klebersouza

  • only changed the mode that spinner appears. It continues without the line

  • 1

    Kleber, I think this is a pattern from Material Design, in Android 5.0, Spinner has a different style. If you can see in Android 4.4, maybe this line appears. A suggestion is to put a simple "View" with height of 1dp to simulate that partition. The lack of that line down there is not bug no :D

  • Blz Wakim will do just that, thank you

  • I did some research here, it really changes according to the theme, in your other question I answered I told you this @Klebersouza

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.