如何调用动作条的文本菜单样的行为? [英] How to invoke the ActionBar's ContextMenu-like behavior?

查看:111
本文介绍了如何调用动作条的文本菜单样的行为?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在的Andr​​oid 3.0,当您选择一些文本例如,动作条切换到文本菜单式的模式,使你做的动作与所选文本:复印/股的/ etc,和一个完成按钮出现在左侧,以使用户离开这个模式

In Android 3.0, when you select some text for example, the ActionBar switches to a ContextMenu-like mode, which enables you to do actions with the selected text: copy/share/etc, and a "Done" button appears on the left side to enable the user to leave this mode.

我如何切换动作条到这个模式在我的应用程序(我的菜单,当然项)?我只是找不到此的文档。

How can I switch the ActionBar into this mode in my app (with my menu items of course)? I just couldn't find this in the docs.

推荐答案

是啊,我找不到它要么 - 我不得不问,在谷歌I |。0

Yeah, I couldn't find it either -- I had to ask at Google I|O.

使用<一个href="http://developer.android.com/reference/android/app/Activity.html#startActionMode%28android.view.ActionMode.Callback%29"><$c$c>startActionMode(). <一href="http://developer.android.com/resources/samples/HoneycombGallery/src/com/example/android/hcgallery/ContentFragment.html">Here是他们的样品演示它之一。我需要做更多的工作,在这方面我自己。

Use startActionMode(). Here is one of their samples that demonstrates it. I need to do more work in this area myself.

这篇关于如何调用动作条的文本菜单样的行为?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆