[英]Remove icon from searchView widget (not in actionBar)
看來SearchView擴展了LinearLayout。 我猜方向是水平的。
您可以獲取SearchView的實例,然后刪除第一個孩子。 我沒有嘗試過,但是我認為它會起作用。
SearchView searchView = (SearchView)findViewById(R.id.search);
// You have to play around with this but I think 0 is the right value
LinearLayout linearLayout = (LinearLayout) searchView.getChildAt(0);
linearLayout.removeViewAt(1);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.