0
0

More than 3 years have passed since last update.

Android 4系で drawableLeft にベクターリソースを使用する

Posted at

TextViewのdrawableLeftにベクターリソースを使用していたところ、Android4系でクラッシュしてしまいました。
エラーは以下の通り。

 Caused by: android.view.InflateException: Binary XML file line #46: Error inflating class TextView
 ..略
 Caused by: android.content.res.Resources$NotFoundException: File res/drawable/ic_info_outline_grey_700_24dp.xml from drawable resource ID #0x7f0700e3

回避方法はAppCompatTextViewTextViewの代わりに使用して、 app:drawableLeftCompatでリソースを指定すること。

参考
https://stackoverflow.com/questions/35761636/is-it-possible-to-use-vectordrawable-in-buttons-and-textviews-using-androiddraw

0
0
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
0
0