SearchView remove blue focus line and show cursor at certain position

前端 未结 3 968
旧时难觅i
旧时难觅i 2021-02-05 15:30

I have been trying to remove the blue focus line in the SearchView .I am casting it to a AutoCompleteTextView so that I can use customized icons for my searchView.



        
3条回答
  •  心在旅途
    2021-02-05 15:43

    I was able to solve it by setting the background of the default searchview plate as follows

    int searchPlateId = searchView.getContext().getResources()
                .getIdentifier("android:id/search_plate", null, null);
        View searchPlateView = searchView.findViewById(searchPlateId);
        if (searchPlateView != null) {
            searchPlateView.setBackgroundColor(Color.BLACK);
        }
    

    This article helped.article link

提交回复
热议问题