0
해결 방법을 찾을 수없는 매우 일반적인 문제가 있습니다. 프로그래밍 방식으로 내 벡터를 설정하고 있습니다. 나는 색조 색도 프로그래밍 방식으로 바꿀 수 있기를 원합니다. 가장 큰 문제는프로그래밍 방식으로 벡터 드로어 블을 설정하십시오. 롤리팝
iv.setImageDrawable(d);
함께 제공 등 Programmatically tint a 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);
로 발견 된 일부 솔루션은 내가 어떤을 찾을 수있는 prelolipop 만
iv.setImageResource(int resource)
와 뷰의 당김을 설정 수락 발견 drawable 파일로 설정하기위한 솔루션.
실제로 드로어 블을 올바르게 설정하는 데 문제가있었습니다. Drawable vectorIcon = VectorDrawableCompat.create (view.getResources(), vectorDrawableSource, themeSource)를 사용하는 경우; 잘 작동합니다! 감사합니다. – zeromaro