Android 叠加动作条
我试图覆盖动作栏。我的目标是API级别8到19。从正式文件:Android 叠加动作条,android,eclipse,android-actionbar,android-styles,android-actionbar-compat,Android,Eclipse,Android Actionbar,Android Styles,Android Actionbar Compat,我试图覆盖动作栏。我的目标是API级别8到19。从正式文件: <resources> <!-- the theme applied to the application or activity --> <style name="CustomActionBarTheme" parent="@android:style/Theme.AppCompat"> <item name="android:windo
<resources>
<!-- the theme applied to the application or activity -->
<style name="CustomActionBarTheme"
parent="@android:style/Theme.AppCompat">
<item name="android:windowActionBarOverlay">true</item>
<!-- Support library compatibility -->
<item name="windowActionBarOverlay">true</item>
</style>
</resources>
我怎样才能解决这个问题?非常感谢。我也遇到了这个问题,我通过添加工具修复了它:tagetApi=“11”属性:
<item tools:targetApi="11" name="android:windowActionBarOverlay">true</item>
true
您还应该将xmlns添加到xml文件的资源标记中:
<resources xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android">
<resources xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android">
也有同样的问题(我想知道为什么官方文件中没有提到这一点)。只需使用以下附加工具抑制警告:忽略语句:
<item name="android:windowActionBarOverlay" tools:ignore="NewApi">true</item>
true
为了实现这一点,您还需要名称空间:
<resources xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android">
<resources xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android">
使用此true
不带前缀的用于从支持库读取样式的旧版本。它对两者都有效吗?使用true
低于11级,使用true
高于11级的api OK,但是我收到了问题中指定的错误。请在相应的res/values文件夹中的不同sytles.xml中使用它