抱歉,这是我第一次在这里提问。所以,我没有上传图像来描述的权限。没关系。我想做的是像这样的一行ListView。左侧的块是一个图标。
非常感谢您能反馈正确的XML标记。感谢。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~
-------
| |一些文字一些文字
| |一些文字一些文字
-------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ < BR />
答案 0 :(得分:0)
<LinearLayout android:layout_height="wrap_content"
android:layout_width="fill_parent">
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:src="@drawable/image" />
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Some text some text some text some text"
android:layout_weight="1" />
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Some text some text some text some text"
android:layout_weight="1" />
</LinearLayout>
答案 1 :(得分:0)
在过去的几个小时里,我终于找到了解决方案。希望这可以为其他人提供一些帮助。这是我对这个论坛的第一次贡献。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="60px">
<ImageView
android:layout_centerVertical="true"
android:id="@+id/image"
android:layout_height="32px"
android:layout_width="32px"
android:layout_marginLeft="20px" />
<TableLayout
android:layout_height="fill_parent"
android:layout_marginRight="0px"
android:layout_width="fill_parent"
android:layout_marginLeft="62px">
<TableRow
android:minHeight="30px">
<TableRow
android:layout_width="fill_parent"
android:minHeight="40px">
<TextView
android:text="SOME TEXT"
android:layout_width="wrap_content"
android:ellipsize="end"
android:id="@+id/title"
android:textSize="10pt"
android:width="150px"
android:layout_gravity="fill_vertical"
android:gravity="bottom"
android:minHeight="40px"
android:textStyle="bold" />
<TextView
android:text="99999"
android:id="@+id/amount"
android:textSize="10pt"
android:paddingRight="20px"
android:minHeight="40px"
android:gravity="bottom|right"
android:textStyle="bold"
android:width="108px" />
</TableRow>
</TableRow>
<TableRow
android:minHeight="20px">
<TableRow
android:layout_width="fill_parent">
<TextView
android:text="SOME TEXT"
android:layout_width="wrap_content"
android:ellipsize="end"
android:id="@+id/description"
android:width="150px"
android:gravity="top"
android:layout_gravity="fill_vertical"
android:minHeight="20px" />
<TextView
android:text="some text"
android:id="@+id/date"
android:paddingRight="20px"
android:minHeight="20px"
android:gravity="top|right"
android:width="108px" />
</TableRow>
</TableRow>
</TableLayout>
</RelativeLayout>