アイコンをDLして直で参照する

Material Symbols and Icons – Google Fonts
Material Symbols are our newest icons consolidating over 2,500 glyphs in a single font file with a wide range of design …

上記からアイコン(Androidタブのxml)をダウンロードしてdrawableフォルダに入れる。

xmlファイルを開き

android:tint="?attr/colorControlNormal"

を削除する(これを消さないとビルド時に参照エラーになる)。

色をAndroid Studioで決めたい場合は

android:fillColor = "@color/icon_color"

等にしてAndroid Studioで指定する。

drawableから参照するコード

ImageVector.vectorResource(id = R.drawable.xmlファイル名_拡張子なし)
タイトルとURLをコピーしました