大佬教程收集整理的这篇文章主要介绍了在Android工具栏中更改背面和清除图标的SearchView颜色,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
解决方案1:
<style name="AppTheme" parent="@style/Theme.base.AppCompat.Light.DarkActionBar"> <item name="actionBarWidgetTheme">@style/YourActionBarWidget</item> </style> <style name="YourActionBarWidget" parent="@style/Theme.AppCompat"> <item name="searchViewCloseIcon">@drawable/xxx</item> </style>
解决方案2:
final Drawable upArrow = getresources().getDrawable(R.drawable.abc_ic_ab_BACk_mtrl_am_alpha); upArrow.setColorFilter(getresources().getColor(R.color.WHITE),PorterDuff.Mode.SRC_ATOp); getSupportActionBar().setHomeAsUpInDicator(upArrow);
我的项目styles.xml
<style name="ToolBarTheme" parent="@style/Theme.AppCompat.Light"> <item name="colorPriMary">@color/blue</item> <item name="colorPriMaryDark">@color/blue</item> <item name="windowNotitle">true</item> <item name="windowActionBar">false</item> <item name="drawerArrowStyle">@style/DrawerArrowStyle</item> <item name="android:itemTextAppearance">@style/myCustomMenuTextApearance</item> <item name="android:actionMenuTextColor">@color/white</item> <item name="actionMenuTextColor">@color/white</item> </style> <style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle"> <item name="spinBars">true</item> <item name="color">@color/white</item> <item name="gapbetweenBars">2.5dip</item> <item name="thickness">2dp</item> </style>
我的确切问题的屏幕截图:
以上是大佬教程为你收集整理的在Android工具栏中更改背面和清除图标的SearchView颜色全部内容,希望文章能够帮你解决在Android工具栏中更改背面和清除图标的SearchView颜色所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。