2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Viewのフォントを変えたい!!!(初級者の叫び)

Last updated at Posted at 2020-12-09

動機

9月からAndroid開発を始めてすっかりドはまり中のLaOです。

アプリ作成中にデフォルトのフォントだと、あんまし作りたいアプリの趣旨に合わないなぁと思い、フォントを変えようと思い立った。(まぁ、これでもそんなに問題はないのだが)

2020-12-09 (8).png

フォント変更について、曲がりなりにも調べるとどうやらフォントカスタムなるものをダウンロードして、resフォルダ内のfontディレクトリを作り、その中に格納するらしいのだが一向に上手くいかない。

フォントを変更するには、xmlファイルでfontfamily属性を用いるのだが、@font…と打ち込んでも候補にそいつらが出てこないのだ。(こっちの解決策は誰か教えてください || いつか解決させる)

ほんで、暫くググりに没頭していると簡単に解決できたのでそれを綴っていこうと思います。

2020-12-09 (2).png

解決策

①フォントを変えたいViewをタップし注目。右側のAttibutesタブを開き、Declared Attributesの右横の+を押してfontfamilyを追加する。▽をタップし一番下のMore Fonts…を選択。
2020-12-09 (14).png
②開いたらさぁ、この中から好きなフォントを探そう!筆者は、鉛筆で書いたようなフォントにしたかったので「Casual」を選択。
2020-12-09 (13).png
一つが完成しました。あとは、同じように繰り返していくだけ。
2020-12-09 (16).png

完成

2020-12-09 (11).png

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?