显示ActionMode在工具栏 [英] Display ActionMode over Toolbar
问题描述
我试图使用 android.view.ActionMode
新 android.support.v7.widget.Toolbar
,除了传统的 android.app.ActionBar
。我能够与显示它:
toolbar.startActionMode(回调);
的问题是, ActionMode
显示在动作条
,而不是在工具栏
。有没有办法来改变这种状况?
我tryied设置在我的主题下,但它似乎并没有改变什么:
<项目名称=windowActionModeOverlay>真< /项目>
由于您使用的是
工具栏
,我还以为你正在使用AppCompatActivity
键,取代了内置的动作条
与 您的自定义工具栏
使用setSupportActionBar(工具栏);
首先确保您输入正确的名称空间。
进口android.support.v7.view.ActionMode;
和不
进口android.view.ActionMode;
然后用
_actionMode = startSupportActionMode(本);
和不
_actionMode = startActionMode(本);
I am trying to use the android.view.ActionMode
with the new android.support.v7.widget.Toolbar
, in addition to the traditional android.app.ActionBar
. I am able to display it with:
toolbar.startActionMode(callback);
The problem is that the ActionMode
is displayed over the ActionBar
, and not over the Toolbar
. Is there a way to change that?
I tryied to set the following in my theme, but it does not seem to change anything:
<item name="windowActionModeOverlay">true</item>
Since you are using the
Toolbar
, I also assume you are using theAppCompatActivity
and have replaced the built inActionBar
with your customToolbar
usingsetSupportActionBar(toolbar);
First of all ensure you are importing the correct namespace.
import android.support.v7.view.ActionMode;
and NOT
import android.view.ActionMode;
then use
_actionMode = startSupportActionMode(this);
and NOT
_actionMode = startActionMode(this);
这篇关于显示ActionMode在工具栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!