在Android中,设置高程仍在ActionBar下方显示阴影 [英] Set elevation still display shadow below ActionBar in Android

查看:177
本文介绍了在Android中,设置高程仍在ActionBar下方显示阴影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

values/styles.xml内部,我已将<item name="elevation">0dp</item>设置为我的AppTheme样式.在values-21/styles.xml里面,我已经设置了<item name="android:elevation">0dp</item>,我也尝试了这个 <item name="android:windowContentOverlay">@null</item>.我还尝试了Clean项目和Rebuild项目.并尝试Invalidate Caches and Restart.但是我的模拟器仍然显示阴影,请参见以下屏幕.

Inside values/styles.xml I have set <item name="elevation">0dp</item> to my AppTheme style. and inside values-21/styles.xml I have set <item name="android:elevation">0dp</item> and I Have also try this <item name="android:windowContentOverlay">@null</item>.I have also try to Clean the Project and Rebuild the Project. and also try to Invalidate Caches and Restart. But my Emulator still display shadow see the below screen.

问题:

如何将下面的阴影删除到ActionBar.

How to remove that shadow below to ActionBar.

ScreenShot:

推荐答案

我不知道为什么elevationstyle中不起作用.但是当我以编程方式设置它时,一切正常.

I don't know why elevation is not work in style. but When I set it programatically It's just work fine.

 getSupportActionBar().setElevation(0);

输出:

这篇关于在Android中,设置高程仍在ActionBar下方显示阴影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆