【问题标题】:Set font custom searchview Android studio设置字体自定义searchview Android studio
【发布时间】:2020-04-21 11:08:43
【问题描述】:

为搜索视图选择自定义字体:

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

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

【问题讨论】:

    标签: android-studio searchview


    【解决方案1】:
     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);
    

    【讨论】:

      猜你喜欢
      • 2015-06-08
      • 2019-07-22
      • 2014-06-16
      • 2017-07-19
      • 1970-01-01
      • 2022-12-23
      • 2014-08-18
      • 2012-11-22
      • 1970-01-01
      相关资源
      最近更新 更多