删除searchIcon

时间:2014-03-11 14:19:22

标签: android android-actionbar android-search

我想删除searchView的提示字段中的搜索图标(参见附图)。

enter image description here

我尝试了多种解决方案,尤其是:

int magId = getResources().getIdentifier("android:id/search_mag_icon", null, null);
ImageView magImage = (ImageView) searchView.findViewById(magId);
magImage.setLayoutParams(new LinearLayout.LayoutParams(0, 0));

取自:Remove the SearchIcon as hint in the searchView,但没有任何成功。想法? :)

0 个答案:

没有答案