如何改变对搜索查看默认的图标,将在Android上的操作栏的使用? [英] How to change the default icon on the SearchView, to be use in the action bar on Android?

查看:127
本文介绍了如何改变对搜索查看默认的图标,将在Android上的操作栏的使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一点麻烦,定制的搜索查看搜索图标。在我的角度来看,该图标可以在项目属性进行更改,对不对?只需选中code波纹管。

I'm having a bit of trouble customizing the search icon in the SearchView. On my point of view, the icon can be changed in the Item attributes, right? Just check the code bellow..

谁能告诉我什么,我做错了吗?

Can someone tell me what I'm doing wrong?

这是我使用的菜单,我的自定义搜索图标 icn_lupa 。但是,当我运行的应用程序,我总是得到默认的搜索图标...

This is the menu I'm using, with my custom search icon icn_lupa. But when I run the app, I always get the default search icon...

<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/menu_search"
      android:title="@string/menu_search"
      android:icon="@drawable/icn_lupa"
      android:showAsAction="always"
      android:actionViewClass="android.widget.SearchView" />
</menu>

在此先感谢。

Thanks in advance.

推荐答案

它看起来像actionViewClass会取代图标,它看起来并不像宥可以将它从的这个类

It looks like the actionViewClass overides the icon and it doesn't look like yuo can change it from this class.

您有两个解决方案:

这篇关于如何改变对搜索查看默认的图标,将在Android上的操作栏的使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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