android - 什么是modal selection选择模式?

标签 android listview modal-dialog selection

当我将 ListView 的选择模式设置为多个时,我遇到了 Android API 级别 11 中引入的这个常量:CHOICE_MODE_MULTIPLE_MODAL . JavaDoc 对我帮助不大:

public static final int CHOICE_MODE_MULTIPLE_MODAL

The list allows multiple choices in a modal selection mode.

什么是模态选择模式?到处都找不到。

最佳答案

这用于在使用操作栏时调出操作模式(也称为上下文操作栏)。您会在 Gmail 等应用中看到它:当您开始检查列表中的项目时,操作栏会从一般 Activity 级操作变为要在列表上执行的操作(例如,更改标签、垃圾)。

CHOICE_MODE_MULTIPLE 一样,您需要将 ListView 填充为 Checkable 项目。不过,一旦选中一个或多个项目,Android 将自动弹出您选择的操作模式,您可以使用自己的操作配置该模式。

下面是一个示例项目,演示了这一点:https://github.com/commonsguy/cw-omnibus/tree/master/ActionMode/ActionModeMC

关于android - 什么是modal selection选择模式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12712663/

相关文章:

java - 在 fragment 和列表 fragment 之间切换会导致错误

php - 将图像字符串 URL 显示到 ListView Android PHP 到 JSON 数组

javascript - 在页面上多次使用时 iframe 的问题

android - 更改 Android UI 表库中的背景(thiagolocatelli)

android - 按日期排序 ListView Android

angularjs - Angularstrap - 模态框

css - 调整 Shiny 进度条的大小并将其居中

android - 在 Android 应用程序中使用 JAR(库)

android - 在 Android 中使用 Volley 库时数据未发布到服务器

android - 无法为 SharedPreferences 或数据库创建目录