上下文操作栏的蜂窝上下文、蜂窝、操作

2023-09-12 02:10:20 作者:淺藍Se菂微笑

我期待复制的操作栏执行从蜂巢的Gmail应用程序

I'm looking to copy the action bar implementation from the gmail app in Honeycomb

不幸的是,我不能张贴图片,因为我是新来的。

Unfortunately I can't post an image because I'm new here.

基本上,当你选择一个电子邮件或更多你的动作条动画与一个不同的动作吧: 1.Contextual按钮

Basically, when you select an email or more your action bar animates into a different action bar with: 1.Contextual buttons

2.A新的完成按钮会出现在主页图标。

2.A new "Done" button appears over the Home icon.

有没有人有任何想法如何做到这一点?

Does anyone have any idea how to do this?

推荐答案

调用startActionMode方法可在任何视图或活动。此方法接受一个ActionMode.Callback对象将管理情境模式的生命周期。 startActionMode 将返回一个ActionMode对象,如果启动模式是成功的,或如果请求被拒绝了。

Call the startActionMode method available on any View or your Activity. This method accepts an ActionMode.Callback object that will manage the lifecycle of the contextual mode. startActionMode will return an ActionMode object if starting the mode was successful, or null if the request was rejected.

如果你是专门创建多重选择模式的ListView中,你可以走了一条捷径,并使用 CHOICE_MODE_MULTIPLE_MODAL

If you are specifically creating a multiple selection mode for a ListView, you can take a shortcut and use CHOICE_MODE_MULTIPLE_MODAL.