[英]Why does appcompat-v7:22.2.0 break ActionMode overlaying ActionBar?
In my project I have a screen that uses action mode via: 在我的项目中,我有一个通过以下方式使用操作模式的屏幕:
mActionMode = getActivity().startActionMode(this);
I need this to "overlay" my action bar rather than push everything down. 我需要它来“覆盖”我的操作栏,而不是将所有内容都按下。 I achieve this using the following theme:
我使用以下主题实现此目的:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowActionModeOverlay">true</item>
</style>
So far this has worked fine when using version 22.1.0 of the appcompat library: 到目前为止,当使用appcompat库的22.1.0版本时,此方法运行良好:
compile 'com.android.support:appcompat-v7:22.1.0'
This is the result - perfect - 这就是结果-完美-
Recently I upgraded to version 22.2.0 of the appcompat library: 最近,我升级到了appcompat库的22.2.0版本:
compile 'com.android.support:appcompat-v7:22.2.0'
Now I have the following: 现在我有以下内容:
As you can see, the "overlay" behaviour is completely broken. 如您所见,“覆盖”行为被完全破坏了。 Am I missing something here?
我在这里想念什么吗?
FYI - I am using a ToolBar in my XML layout and then using: 仅供参考-我在XML布局中使用工具栏,然后使用:
activity.setSupportActionBar(mToolbar);
You should use the appcompat
style attribute, without the framework prefix: 您应该使用
appcompat
样式属性,不带框架前缀:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="windowActionModeOverlay">true</item>
</style>
I'm not 100% sure, but I believe that for newer API versions it would be good to also keep the framework version, thus: 我不确定100%,但是我相信对于较新的API版本,最好还保留框架版本,因此:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="windowActionModeOverlay">true</item>
<item name="android:windowActionModeOverlay">true</item>
</style>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.