何らかの理由で、SearchViewでタイプフェイスを設定できません。Android - SearchView - setTypefaceが利用できない
searchView = findViewById(R.id.searchview_invite_friends_search_contact);
Typeface myFont = Typeface.createFromAsset(getAssets(),"fonts/myFont.ttf");
searchView.setTypeface(myFont);
私はXMLでこのようにそれを定義した:SearchViewは、あなたが最初に見つける必要があるのTextViewが含まれてい
<SearchView
android:id="@+id/searchView"
android:layout_width="match_parent"
android:queryHint="@string/searchview_invite_friends_search_contact"
android:iconifiedByDefault="false"
android:layout_centerHorizontal="true"
android:background="@android:color/white"
android:searchIcon="@drawable/icon_search"
android:focusable="false"
android:layout_height="45dp"
android:queryBackground="@color/transparent"
android:gravity="center_horizontal"
>
確かにはるかに優れています:)ありがとう! – Isabelle