【问题标题】:Select multiple items in ListFragment在 ListFragment 中选择多个项目
【发布时间】:2012-12-29 16:57:47
【问题描述】:

如何将 ListFragment 中的 ListView 设置为多项选择?在标准活动中,我将在 xml 文件中指定 android:choiceMode="multipleChoice",并在附加适配器时使用 android.R.layout.simple_list_item_activated_1 作为 textViewResourceId,一切正常,但在 ListFragment 中,选择的项目没有像使用 @ 那样突出显示987654323@,选择模式为singleChocie。

【问题讨论】:

    标签: android listview android-listview android-fragments android-listfragment


    【解决方案1】:

    如何将 ListFragment 中的 ListView 设置为多选?

    getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE) 来自 Java,或者在您的适配器设置之外提供您自己的在 ListView 中使用 android:choiceMode="multipleChoice" 的布局文件。

    【讨论】:

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