android5.0阴影,android 5.0之后toolbar阴影肿么去除

本文介绍了如何在Android 5.0及更高版本以及支持库中去除Action Bar下方的阴影。对于Android 5.0及以上,可以在样式中设置`android:elevation=0dp`;对于支持库兼容性,同样设置`elevation=0dp`。给出了适用于AppCompat Light主题的示例,并展示了如何将自定义ActionBar样式应用到应用程序主题。对于Android 5.0之前的版本,还需在主题中添加`android:windowContentOverlay=@null`来移除阴影。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

For Android 5.0, if you want to set it directly into a style use:

item name=android:elevation0dp/item

and for Support library compatibility use:

item name=elevation0dp/item

Example of style for a AppCompat light theme:

style name=Theme.MyApp.ActionBar parent=style/Widget.AppCompat.Light.ActionBar.Solid.Inverse

!-- remove shadow below action bar --

!-- item name=android:elevation0dp/item --

!-- Support library compatibility --

item name=elevation0dp/item

/style

Then apply this custom ActionBar style to you app theme:

style name=Theme.MyApp parent=Theme.AppCompat.Light

item name=actionBarStyle@style/Theme.MyApp.ActionBar/item

/style

For pre 5.0 Android, add this too to your app theme:

!-- Remove shadow below action bar Android 5.0 --

item name=android:windowContentOverlay@null/item

取消

评论

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值