Fila ListView de Android no visible
Frecuentes
Visto 327 veces
-1
I am trying to make a ListView row that has an icon to the left, followed by two stacked rows to the right. However, for some reason the bottom row on the right is not showing up. My question to the StackOverflow experts is: what is incorrect in my XML to make the bottom row not show up?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="6dip" >
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="6dip"
android:src="@drawable/ap" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="40dip" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="20dip" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="20dip" >
<TextView
android:id="@+id/bssid"
android:layout_width="140dip"
android:layout_height="20dip"
android:gravity="center_vertical|left"
android:textColor="@color/foreground" />
<TextView
android:id="@+id/ssid"
android:layout_width="190dip"
android:layout_height="20dip"
android:layout_alignParentTop="true"
android:layout_toRightOf="@id/bssid"
android:gravity="center_vertical|right"
android:textColor="@color/foreground" />
<TextView
android:id="@+id/enc"
android:layout_width="100dip"
android:layout_height="20dip"
android:layout_alignParentTop="true"
android:layout_toRightOf="@id/ssid"
android:gravity="center_vertical|right"
android:textColor="@color/foreground" />
<TextView
android:id="@+id/power"
android:layout_width="70dip"
android:layout_height="20dip"
android:layout_alignParentTop="true"
android:layout_toRightOf="@id/enc"
android:gravity="center_vertical|right"
android:textColor="@color/foreground" />
</RelativeLayout>
<RelativeLayout
android:layout_height="20dip"
android:layout_width="match_parent" >
<TextView
android:id="@+id/mgmt"
android:layout_width="55dip"
android:layout_height="20dip"
android:gravity="center_vertical|right"
android:textColor="@color/foreground" />
<TextView
android:id="@+id/data"
android:layout_width="55dip"
android:layout_height="20dip"
android:layout_toRightOf="@id/mgmt"
android:gravity="center_vertical|right"
android:textColor="@color/foreground" />
<TextView
android:id="@+id/manuf"
android:layout_width="200dip"
android:layout_height="20dip"
android:layout_toRightOf="@id/data"
android:gravity="center_vertical|right"
android:textColor="@color/foreground" />
<TextView
android:id="@+id/lastseen"
android:layout_width="140dip"
android:layout_height="20dip"
android:layout_toRightOf="@id/manuf"
android:gravity="center_vertical|right"
android:textColor="@color/foreground" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
Also, if you have a better idea or way to do this, I am certainly open to it. Thank you for your help.
1 Respuestas
1
@Aprian and @prijupaul figured this one out. By default, LinearLayout is horizontal, and I needed it to be set to vertical. So, I modified by LinearLayout to include:
android:orientation="vertical"
... and it works correctly. Thank both of you for your help.
Respondido el 09 de Septiembre de 13 a las 02:09
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas android xml listview or haz tu propia pregunta.
Su
2nd LinearLayout
(4th view
) debería tener40dip
as its height. - AprianThank you for the idea, but that still didn't fix it. The bottom row is still not visible. - user1722919
Your linearlayout should have a orientation. sometimes missing this will messup the layouts. - prijupaul
That's it. By default,
LinearLayout
la orientación eshorizontal
, deberías configurarandroid:orientation="vertical"
- AprianThank you, @prijupaul and Aprian, that worked. - user1722919