我想删除searchView的提示字段中的搜索图标(参见附图)。
我尝试了多种解决方案,尤其是:
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,但没有任何成功。想法? :)