【发布时间】:2011-11-28 20:20:24
【问题描述】:
我正在使用 ListView 提供一个列表供用户选择。
这里是主要代码:
SimpleAdapter adapter = new SimpleAdapter(this,contacts, R.layout.list_contact,
from_contacts, to_contacts);
listview_selected_contact.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
listview_selected_contact.setAdapter(adapter);
我想知道为什么复选框不显示? 程序在没有可见复选框的情况下正常运行。 有人可以帮忙吗?
这里是xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="TextView" android:textAppearance="?android:attr/textAppearanceMedium" android:id="@+id/username"></TextView>
</LinearLayout>
【问题讨论】:
-
我认为这是因为您提供了自己的布局。向我们展示您的 layout.xml