Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
アプリケーションで textView のフォントをカスタマイズできるように、ファイル .ttf を追加したいと考えています。
どのように搾取されたのだろうか?
DaFontでファイルをダウンロードします。
よろしくお願いします。
まず、フォントを/assetsプロジェクト内のフォルダーにコピーしてから、次のように設定しTypefaceますTextView。
/assets
Typeface
TextView
Typeface myFont = Typeface.createFromAsset(getAssets(), "dafont.ttf"); myTextView.setTypeface(myFont);
編集:修正されたディレクトリ