Skip to content Skip to sidebar Skip to footer

How Can I Change The Font Of Search View Suggestion?

I searched for hours all they suggest is using customized cursor adapter. however I'm using content provider to fill the suggestion and don't have any cursor adapter . I'm able to

Solution 1:

You would get a handle to the textview from the sdk and then change it since they don't expose it publicly.

Try this code:

intid= searchView.getContext().getResources().getIdentifier("android:id/search_src_text", null, null);
TextViewtextView= (TextView) searchView.findViewById(id);
Typefacetype= Typeface.createFromAsset(getAssets(),"fonts/Kokila.ttf"); 
textView.setTypeface(type);

Solution 2:

To change the font of text you have to implement your own CursorAdapter and in bindView() method get the reference to the TextView and apply the font using TextView.setTypeface().

Post a Comment for "How Can I Change The Font Of Search View Suggestion?"