【发布时间】:2015-03-16 11:20:05
【问题描述】:
我正在关注 official developer's guide 以覆盖操作栏。
我的style.xml如下:
<!-- Base application theme. -->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
<style name="AppTheme" parent="AppBaseTheme">
<item name="actionBarStyle">@style/CustomActionBarTheme</item>
</style>
<style name="CustomActionBarTheme"
parent="@android:style/Theme.Holo">
<item name="android:windowActionBarOverlay">true</item>
</style>
我的 midSdkVersion 是 14,预期输出类似于官方指南:。
相反,在我的情况下,输出是:
(我已经为活动设置了背景颜色...但它没有覆盖操作栏。)
如果我做错了什么,请帮助我。
编辑:
我想要在 airnb 和许多其他应用程序中使用类似的操作栏。谁能给我完整的答案?
【问题讨论】:
-
请检查您的清单文件。您可能使用了错误的主题而不是 CustomActionBarTheme。
-
@iDroidExplorer 你能用代码写一个完整的答案吗?我会很感激的。谢谢。
-
您将操作栏设置为覆盖,但您没有将操作栏的背景设置为透明。尝试添加
<item name="android:background">@drawable/actionbar_background</item>和@drawable/actionbar_background是一个半透明的png 图像 -
@Krupal 你能用你的清单文件的代码更新你的问题吗,这样我就可以知道我要问的事情......
标签: android android-layout android-actionbar android-styles