How to set SearchView TextSize?

前端 未结 6 1639
梦毁少年i
梦毁少年i 2020-12-14 15:44

I have a SearchView inside a LinearLayout and I\'m trying to set a different TextSize for it (the SearchView) but when se

6条回答
  •  春和景丽
    2020-12-14 16:11

    Though AutoCompleteTextView is superclass of SearchAutoComplete, SearchView use SearchAutoComplete rather than AutoCompleteTextView. use it and do more.

    SearchView searchView=...;
    SearchView.SearchAutoComplete autoComplete= searchView.findViewById(android.support.v7.appcompat.R.id.search_src_text);
    float textSpSize=10.f;
    if (autoComplete!=null){
        autoComplete.setTextSize(textSpSize);
       }
    

提交回复
热议问题