【发布时间】:2015-12-13 11:42:08
【问题描述】:
有人可以帮我调整我的xml 布局吗?在 Edit_Staff 活动中,我想使用下面的代码从 SQLite 检索图像和文本并将它们加载到 listView。
Edit_Staff
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="start"
android:background="@android:color/white"
android:padding="12dp">
<ImageView
android:id="@+id/image"
android:layout_width="80dp"
android:layout_height="70dp"
android:layout_centerVertical="true"
android:layout_gravity="left"/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/image"
android:layout_marginRight="4dp"
android:layout_centerVertical="true"
android:paddingLeft="6dp"
android:orientation="vertical">
<TextView
android:id="@+id/Claimtype"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:text="Claims Type : "
android:maxLines="1" />
<TextView
android:id="@+id/amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@android:color/secondary_text_dark_nodisable"
android:text="Amount : "
android:maxLines="1"
android:ellipsize="end"
android:layout_below="@+id/Claimtype" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@android:color/secondary_text_dark_nodisable"
android:text="Description : "
android:maxLines="1"
android:layout_below="@+id/amount" />/>
</RelativeLayout>
</RelativeLayout>
【问题讨论】:
-
有什么问题?有什么要调整的?
-
@Ron 我想要左侧的 imageView,右侧的文本。
-
你可以试试这个:mysamplecode.com/2012/07/…
-
@Ron 没有。我知道如何创建 listView,但我不知道如何将 xml 布局设置为 this
标签: android xml image android-layout listview