[英]Android Flat ActionBar (without shadow)
i'm trying to create the a flat action bar without shadow 我正在尝试创建一个没有阴影的平面动作栏
attached image: 附图:
my style xml 我的风格xml
<resources>
<!-- the theme applied to the application or activity -->
<style name="CustomActionBarTheme" parent="@android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">@style/MyActionBar</item>
</style>
<!-- ActionBar styles -->
<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="android:background">@drawable/white_bg</item>
<item name="android:displayOptions"></item>
</style>
I'm supporting android 4.x 我支持android 4.x.
Any ideas ? 有任何想法吗 ? I tried changing the style to Solid/Inverse didn't work..
我尝试将样式更改为Solid / Inverse不起作用..
white_bg attached (It's hard to see since it's white) 附上white_bg(很难看,因为它是白色的)
it should look like this 它看起来应该是这样的
<resources>
<!-- the theme applied to the application or activity -->
<style name="CustomActionBarTheme" parent="@android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">@style/MyActionBar</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<!-- ActionBar styles -->
<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:windowActionBarOverlay">true</item>
<item name="android:background">@drawable/white_bg</item>
<item name="android:displayOptions"></item>
</style>
应在Activity
主题( CustomActionBarTheme
)上设置null windowContentOverlay
属性,而不是在ActionBar
主题上设置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.