在Android中,设置高程仍在ActionBar下方显示阴影 [英] Set elevation still display shadow below ActionBar in Android
问题描述
在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:
推荐答案
我不知道为什么elevation
在style
中不起作用.但是当我以编程方式设置它时,一切正常.
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屋!