简体   繁体   English

如何更改工具栏searchView下拉菜单主题,使其在android应用中轻巧

[英]how can I change toolbar searchView drop down menu theme to be light in android app

i have developed an android app with search view on action bar but the suggestion drop down menu items are dark. 我已经开发了带有操作栏上的搜索视图的android应用,但是建议下拉菜单项很暗。 is there a way i can turn the drop down menu to light ? 有什么办法可以使下拉菜单变亮?

this is my style.xml file 这是我的style.xml文件

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>

    <!--<item name="android:dropDownListViewStyle">@android:style/Widget.DeviceDefault.Light.ListView.DropDown</item>-->
    <item name="colorAccent">@color/colorAccent</item>
    <item name="android:actionBarWidgetTheme">@style/Widget.AppCompat.Light.ActionBar</item>
    <item name="android:popupMenuStyle">@android:style/Widget.Holo.Light.PopupMenu</item>
    <!--<item name="android:dropDownListViewStyle">@android:style/Theme.Light</item>-->
</style>

<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

<style name="AppTheme.ButtonBase" parent="Widget.AppCompat.Button.Colored">
    <item name="android:paddingTop">12dip</item>
    <item name="android:paddingBottom">12dip</item>
    <item name="android:textSize">16.9sp</item>
    <item name="android:textStyle">bold</item>
</style>

<style name="AppTheme.ButtonPrimary" parent="AppTheme.ButtonBase">
    <item name="colorButtonNormal">@color/buttonPrimary</item>
    <item name="android:textColor">@color/textLight</item>
</style>


<style name="MineCustomTabText" parent="TextAppearance.Design.Tab">
    <item name="android:textSize">18sp</item>
</style>

<style name="AppTheme.ButtonSecondary" parent="AppTheme.ButtonBase">
    <item name="android:textColor">@color/textLight</item>
</style>

Just comment out your style code. 只需注释掉您的样式代码。

this one 这个

android:dropDownListViewStyle 机器人:dropDownListViewStyle

Now run your app again. 现在再次运行您的应用程序。

It may helped you. 它可能会帮助您。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM