Android的ListView控件随着2 TextViews每件 [英] Android ListView With 2 TextViews Per Item
问题描述
我所看到的净例子包括每个项目只有1 TextView的,他们从数组加载数据。我不明白我怎么指定数据去哪里。例如我的产品布局是这样的:
All the examples I have seen on the net contain only 1 TextView per item and they load data from an array. I don't understand how do I specify which data goes where. For example my item layout looks like this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:id="@+id/receiver"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView android:id="@+id/message"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
我如何将数据保存在数组中,以便它可以用在ListView中有这样的布局?
How do I save data in the array so that it could be used in ListView with this layout?
推荐答案
我想你还没有看很难。 :)有吨的例子在那里它告诉你如何做到这一点。搜索自定义ListView的机器人,你会得到相当少数。
I guess you haven't looked hard. :) There are tons of examples out there which show you how to do it. Search for "Custom ListView Android" and you will get quite a handful.
其中之一就在这里。 http://techdroid.kbeanie.com/2009/07/custom -listview换android.html
One of them is here. http://techdroid.kbeanie.com/2009/07/custom-listview-for-android.html
这篇关于Android的ListView控件随着2 TextViews每件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!