android - Set vector drawable programmatically pre lolipop -
very common problem twist couldn't find solution for. setting vector programmatically. want able change tint color programmatically too. found solutions such programmatically tint support vector
imageview iv = .... drawable d = vectordrawablecompat.create(getresources(), r.drawable.ic_exit_to_app_24dp, null); d = drawablecompat.wrap(d); drawablecompat.settint(d, headertitlecolor); iv.setimagedrawable(d);
the main problem comes
iv.setimagedrawable(d);
i found prelolipop accepts setting view's drawable with
iv.setimageresource(int resource)
i couldn't find solutions setting drawable file.
any suggestions?
use appcompatimageview has setimagedrawable() method.
Comments
Post a Comment