Android expandablelistview组中的2行
我想向下显示两行我的groupview,但只显示一行: 我有这个用于linear_group.xml的代码Android expandablelistview组中的2行,android,expandablelistview,Android,Expandablelistview,我想向下显示两行我的groupview,但只显示一行: 我有这个用于linear_group.xml的代码 <?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="wrap_
<?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="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="3dp"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/primerIcono"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:src="@drawable/img_transparente"
android:visibility="visible" />
<ImageView
android:id="@+id/segundoIcono"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:src="@drawable/img_transparente"
android:visibility="visible" />
</LinearLayout>
<TextView
android:id="@+id/tvRowCodigo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="7dp"
android:singleLine="true"
android:text="12345"
android:textSize="12dp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_marginTop="3dp"
android:layout_weight="3"
android:orientation="horizontal"
android:weightSum="3" >
<TextView
android:id="@+id/tvRowDireccion"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/tvRowGremio"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/tvRowFechaCad"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
第一个图像视图中的3个是图标,但接下来的文本视图中有我想在更多行中显示的,但只显示第一个。我正在附上一张截图
编辑:
可扩展列表视图不显示所有文本视图,第二个和第三个文本视图是“direccion delservice”和gremiodel estudiandte y profession“但只给我看迪雷西翁·德尔和格雷米奥·德尔。我想在第二行显示te rest您需要更改XML以同时使用水平和垂直线性布局标注。基本上可以创建包含两个水平线性布局的垂直线性布局 在伪代码中类似这样:
<LinearLayout Vertical>
<LinearLayout Horizontal> (row 1)
Widgets for Row 1
</LinearLayout>
<LinearLayout Horizontal> (row 2)
Widgets for Row 2
</LinearLayout>
</LinerLayout>
(第1行)
第1行的小部件
(第2行)
第2行的小部件
好的,所以问题的描述有点难理解,但我会尝试为您指出正确的方向。我假设您试图在单独的行中列出职业、方向和日期文本视图
尝试通过以下方式更改xml格式:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="vertical" > <-make this one vertical
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="3dp"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/primerIcono"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:src="@drawable/img_transparente"
android:visibility="visible" />
<ImageView
android:id="@+id/segundoIcono"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:src="@drawable/img_transparente"
android:visibility="visible" />
</LinearLayout>
<TextView
android:id="@+id/tvRowCodigo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="7dp"
android:singleLine="true"
android:text="12345"
android:textSize="12dp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_marginTop="3dp"
android:layout_weight="3"
android:orientation="horizontal"
android:weightSum="3" >
<TextView
android:id="@+id/tvRowDireccion"
android:layout_width="fill_parent"
android:layout_height="wrap_content" <- instead of fill_parent
android:layout_weight="1"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/tvRowGremio"
android:layout_width="fill_parent"
android:layout_height="wrap_content" <- instead of fill_parent
android:layout_weight="1"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/tvRowFechaCad"
android:layout_width="fill_parent"
android:layout_height="wrap_content" <- instead of fill_parent
android:layout_weight="1"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
我的答案没有改变。。。将“direccion del servicio”和“gremio del estudiandte y profession”文本视图放在第二个水平直线布局中,将所有其他文本视图放在第一个水平直线布局中,您将有两行。