How to fix a spinner that does not show well on android

2

I have a problem with two spinners that are not shown correctly, in the interface, in the simulator the last two spinners are shown with a smaller font than the first one that says It's a Workshop, and testing in real devices in some cases the selected element is not even displayed in the two spinners of workshop type and workshop size, I hope you can give me suggestions as to why this may be happening. I leave the xml code of the activity and a screenshot:

 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_p"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:orientation="vertical"
tools:context="com.sinatsix.josue.jomar.PActivity">

<TextView
    android:id="@+id/texto_saldo"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal"
    android:text="Agregar Taller"
    android:textAppearance="?android:attr/textAppearanceLargeInverse"
    android:textColor="@color/textoView"
    android:layout_weight="1"
    android:textSize="40sp" />

<EditText
    android:id="@+id/nombreTaller"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal"
    android:layout_weight="1"
    android:hint="Nombre Taller"
    android:inputType="text"/>

<CheckBox
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/esCliente"
    android:text="Cliente de JOMAR"
    android:layout_weight="1" />





<TextView
    android:id="@+id/texto_es_sucursal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal"
    android:layout_weight="1"
    android:text="Es un Taller:"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:textColor="@color/textoView" />
<Spinner
    android:id="@+id/es_sucursal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"

    android:layout_weight="1"
    />

<EditText
    android:id="@+id/inpusucursal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal"
    android:layout_weight="1"
    android:hint="Nombre Sucursal"
    android:enabled="false"
    android:inputType="text"/>

<TextView
    android:id="@+id/texttipotaller"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal"
    android:layout_weight="1"
    android:text="Tipo Taller:"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:textColor="@color/textoView" />

<Spinner
    android:id="@+id/tipotaller"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"

    android:layout_weight="1"
    android:spinnerMode="dropdown"
    />


<TextView
    android:id="@+id/texttamanotaller"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal"
    android:layout_weight="1"
    android:text="Tamaño Taller:"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:textColor="@color/textoView" />

<Spinner
    android:id="@+id/tamanotaller"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:layout_gravity="center_horizontal"
    />



<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:layout_weight="1"
    >



    <Button
        android:id="@+id/cancelar"
        style="?android:attr/buttonStyleSmall"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:layout_weight="1"
        android:text="Cancelar"
        android:layout_marginRight="4dp"
        android:textColor="@color/textoBoton"
        android:background="@color/fondoBoton"
        android:onClick="irGuardar" />
    <Button
        android:id="@+id/siguiente"
        style="?android:attr/buttonStyleSmall"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:layout_weight="1"
        android:text="Siguiente"
        android:textColor="@color/textoBoton"
        android:background="@color/fondoBoton"
        android:onClick="optenerCoordenadas" />

</LinearLayout>

    
asked by Josue 12.02.2017 в 21:55
source

1 answer

1

Definitely the layout does not have any property which can change the color or style of the Spinner.

First Spinner:

<Spinner
    android:id="@+id/es_sucursal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"

    android:layout_weight="1"
    />

Second Spinner:

<Spinner
    android:id="@+id/tipotaller"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"

    android:layout_weight="1"
    android:spinnerMode="dropdown"
    />

Third Spinner:

<Spinner
    android:id="@+id/tamanotaller"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:layout_gravity="center_horizontal"
    />

Even the first Spinner shows a text in black while the next two the text is a light gray, which does not correspond to what is defined in the layout. I suggest you add your code to determine where the style change is being made.

    
answered by 13.02.2017 в 05:59