我创建了一个可扩展的listView
,在其中我要并排显示文本,这很可能是我想在那里显示2列的表格。为此,我使用了可扩展列表视图,到目前为止,它看起来像这样(下图)。
至于代码,我在水平Linear Layout
中使用了两个文本视图,并使用自定义适配器在视图中显示数据。这是XML。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/itemText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:textSize="16sp"
android:text="item"/>
<TextView
android:id="@+id/itemText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:textSize="16sp"
android:text="Item2"/>
</LinearLayout>
有人可以建议我该怎么做吗?