私は3つのアイコン:ContextCompat.getDrawable(this, R.drawable.my_vector_drawable)
が必要です。Android:3つのアイコンのうち1つを薄く塗る
まず - 色合いせず、第二 - 色合いと、第三 - すぎる色合いせず、
[OK]をクリックします。 R.drawable.my_vector_drawable
ImageView img1 = (ImageView) findViewById(R.id.img1);
ImageView img2 = (ImageView) findViewById(R.id.img2);
ImageView img3 = (ImageView) findViewById(R.id.img3);
Drawable drawable1 = ContextCompat.getDrawable(this, R.drawable.my_vector_drawable);
Drawable drawable2 = DrawableCompat.wrap(ContextCompat.getDrawable(this, R.drawable.my_vector_drawable));
DrawableCompat.setTintMode(drawable2, PorterDuff.Mode.MULTIPLY);
DrawableCompat.setTintList(drawable2, ContextCompat.getColorStateList(this, R.color.menu_tint_colors));
Drawable drawable3 = ContextCompat.getDrawable(this, R.drawable.my_vector_drawable);
img1.setImageDrawable(drawable1);
img2.setImageDrawable(drawable2);
img3.setImageDrawable(drawable3);
は白の図です。
結果として、色合いのある3つのアイコン(WHY ?!)。
たとえば、ContextCompat.getColor(this, R.color.somecolor)
を設定しようとしましたが、結果は...色合いの付いた2つのアイコン!アイコン2と3、最初のアイコン - 色あいなし(理由は?)
キャッシュされていないドロアブルを読み込むにはどうすればいいですか?またはこの問題を解決する方法は? AppCompat 23.4。+
ああ、そうです、この方法は忘れました!ありがとうございました! – VKDev