Ali Moradi
Ali Moradi

Reputation: 7

Set font custom searchview Android studio

Select the custom font for search view:

searchView = (SimpleSearchView) findViewById(R.id.searchView);

searchView.getSearchEditText().setTypeface(AppFontClass.getCurrentTypeFace(getApplicationContext()));

Upvotes: 1

Views: 99

Answers (1)

Diwakar Singh
Diwakar Singh

Reputation: 287

 TextView searchText = (TextView) searchView.findViewById(android.support.v7.appcompat.R.id.search_src_text);
 Typeface myCustomFont = Typeface.createFromAsset(getAssets(),"fonts/myFont.ttf");
 searchText.setTypeface(myCustomFont);

Upvotes: 1

Related Questions