如何在Android中为SearchView设置自定义字体

问题描述 投票:0回答:1

选择用于搜索视图的自定义字体

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

searchView.getSearchEditText().setTypeface(AppFontClass.getCurrentTypeFace(getApplicationContext()));
android searchview
1个回答
0
投票
 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);
© www.soinside.com 2019 - 2024. All rights reserved.