我可以ImageView通过使用setColorFilter(int color)但是getColorFilter()返回ColorFilter对象而不是int颜色来设置色调.似乎我可以ColorFilter转换为PorterDuffColorFilter具有公共getColor()方法但仍需要使用反射调用,因为它带有注释@hide.这似乎是hacky,并不保证不会破坏.
ImageView
setColorFilter(int color)
getColorFilter()
ColorFilter
int
PorterDuffColorFilter
getColor()
@hide
我是否遗漏了某些东西,或者有人提出了一个更好的解决方案,而不是那种黑客?
android imageview
android ×1
imageview ×1