1

estoy tratando de cambiar el alto en que se mostraría las filas que se verían en un ExpandableListView, sin embargo aunque he modificado el atributo android:layout_height con diferentes valóres, al emular no se notan los cambios, es como si siempre estuviera "wrap_content", son dos Layouts y con ambos pasa igual, si a alguien sabe como solucionarlo, agradezco la ayuda.

A continuacion lo xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginTop="2dp"
android:orientation="horizontal"
android:background="#ccaa4c">

<TextView
    android:id="@+id/list_item_cate_name"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_gravity="center_vertical"
    android:layout_marginLeft="10dp"
    android:textColor="#000f61"
    android:textStyle="bold"
    android:layout_weight="1"
    android:text="Categoria" />

<ImageView
    android:id="@+id/list_item_cate_arrow"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_vertical"
    android:layout_marginRight="16dp"
    android:src="@drawable/ic_arrow_down" />

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_marginBottom="0.8dp"
android:layout_marginTop="0.8dp"
android:orientation="horizontal"
android:gravity="center"
android:background="#142a46">

<ImageView
    android:id="@+id/list_item_scate_icon"
    android:layout_width="20dp"
    android:layout_height="20dp"
    android:layout_marginLeft="16dp"
    android:layout_marginRight="16dp"
    android:src="@mipmap/ic_launcher" />

<TextView
    android:id="@+id/list_item_name"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="0dp"
    android:textSize="15sp"
    android:textColor="#ffffff"
    android:textStyle="bold"
    android:gravity="center_vertical"
    android:text="SubCategoria" />

2
  • Es ese todo el contenido del layout? O falta algo mas? Agrega todo el contenido relevante si esperas una respuesta.
    – Einer
    el 29 oct. 2017 a las 1:34
  • @Einer Si solo eso, ya lo otro sería los códigos java, son dos layous con LinearLayou ambos. el 29 oct. 2017 a las 14:22

1 respuesta 1

1

He solucionado esto agregando dentro de cada Layout un LinearLayout y a estos les coloqué margen:

android:layout_marginTop="7dp" y android:layout_marginBottom="7dp"

con esto logré que se viera mas amplio cada fila:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_marginBottom="0.8dp"
android:layout_marginTop="0.8dp"
android:orientation="vertical"
android:gravity="center"
android:background="#142a46">

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:layout_marginTop="7dp"
    android:layout_marginBottom="7dp">

    <ImageView
        android:id="@+id/list_item_scate_icon"
        android:layout_width="20dp"
        android:layout_height="20dp"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="16dp"
        android:src="@mipmap/ic_launcher" />

    <TextView
        android:id="@+id/list_item_name"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="0dp"
        android:textSize="15sp"
        android:textColor="#ffffff"
        android:textStyle="bold"
        android:gravity="center_vertical"
        android:text="SubCategoria" />

</LinearLayout>

Tu Respuesta

Al pulsar en “Publica tu respuesta”, muestras tu consentimiento a nuestros términos de servicio, política de privacidad y política de cookies

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.