gpt4 book ai didi

Android操作栏溢出菜单去除阴影

转载 作者:行者123 更新时间:2023-11-29 20:24:32 25 4
gpt4 key购买 nike

我想移除操作栏溢出菜单周围的阴影,但我还没有找到允许这样做的任何属性。我正在扩展 Theme.AppCompat。

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat">
<!-- Customize your theme here. -->
<item name="actionOverflowButtonStyle">@style/OverflowButton</item>
<item name="actionOverflowMenuStyle">@style/OverflowMenu</item>
<item name="actionBarStyle">@style/MyActionBarLogo</item>
<item name="android:dropDownListViewStyle">@style/PopupMenuListView</item>
<item name="dropDownListViewStyle">@style/PopupMenuListView</item>
<item name="android:textColor">@color/black</item>
<item name="android:popupMenuStyle">@style/PopupMenu</item>
</style>
<style name="MyActionBarLogo" parent="Widget.AppCompat.ActionBar">
<item name="background">@color/white</item>
<item name="displayOptions">useLogo|showHome</item>

<item name="elevation">0dp</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<style name="OverflowButton" parent="@style/Widget.AppCompat.ActionButton.Overflow">
<item name="android:src">@mipmap/menu_logo</item>
</style>
<style name="OverflowMenu" parent="@style/Widget.AppCompat.PopupMenu.Overflow">
<item name="overlapAnchor">false</item>
<item name="android:dropDownVerticalOffset">52dp</item>
<item name="android:dropDownHorizontalOffset">10dp</item>
</style>
<style name="PopupMenuListView" parent="@style/Widget.AppCompat.ListView.DropDown">
<item name="android:divider">@drawable/menu_divider</item>
<item name="android:dividerHeight">1dp</item>
<item name="android:textColor">@color/black</item>
<item name="android:background">@color/white</item>
</style>
<style name="PopupMenu" parent="@style/Widget.AppCompat.ListPopupWindow">
<item name="android:popupBackground">@color/white</item>
</style>

http://imgur.com/5mbceT9

最佳答案

您可以尝试解决方案 this

getSupportActionBar().setElevation(0);

更新

<style name="MyActionBarLogo" parent="Widget.AppCompat.ActionBar">
<item name="background">@color/white</item>
<item name="displayOptions">useLogo|showHome</item>

<item name="elevation">0dp</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:actionDropDownStyle">@style/DropDownMenuStyle</item>
</style>



<style name="DropDownMenuStyle" parent="Widget.AppCompat.Spinner.DropDown.ActionBar">
<item name="android:background">@android:color/transparent</item>
</style>

关于Android操作栏溢出菜单去除阴影,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32734040/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com