【问题标题】:listview with multi-selection in monodroid在 monodroid 中具有多选功能的列表视图
【发布时间】:2012-03-02 14:31:30
【问题描述】:

如何在单声道中为具有多选功能的 android 创建ListView。请帮助一些源示例。

在java中是listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

我在 android 的 mono 上找不到类似的东西。

使用:list.ChoiceMode = (int)ChoiceMode.Multiple;

未显示原始选择的复选框

【问题讨论】:

  • 你能发布你的代码吗?然后告诉你你是做什么的?
  • ICursor 名称Cursor = ManagedQuery(ContactsContract.Contacts.ContentUri, null, null, null, null);开始管理光标(名称光标); SimpleCursorAdapter adapt = new SimpleCursorAdapter(this, Resource.Layout.test, namesCursor, new string[] { ContactsContract.ContactsColumns.DisplayName }, new int[] {Resource.Id.label}); ListView 列表 = FindViewById(Resource.Id.AddContactsListView); list.ChoiceMode = (int)ChoiceMode.Multiple; list.Adapter = 适应;
  • 不,我不是。我将 SimpleCursorAdapter 与 Resource.Layout.test 一起使用,其中只有复选框

标签: android listview xamarin.android


【解决方案1】:

该方法映射到 Android Mono 中的 ChoiceMode 属性:

view.ChoiceMode = ChoiceMode.Multiple;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多