Issue
I am importing eclipse project to android studio, in eclipse it works fine but in android studio it has problem with setTint.
here is my drawablecompat setting:
public static void tintWidget(Context ctx, View view, int color) {
Drawable wrappedDrawable = view.getBackground();
DrawableCompat.setTint(wrappedDrawable, ctx.getResources().getColor(color));
view.setBackgroundDrawable(wrappedDrawable);
}
with DrawableCompat.setTintList also did not work, error on setTintList
what is the correct code for that?
Solution
It appears you have a dependency missing on app compat v4, try adding it to your build.gradle:
dependencies {
compile 'com.android.support:support-v4:22.2.0'
}
Or whatever SDK version you need instead of 22.2.0
Take a look at: https://developer.android.com/tools/studio/eclipse-transition-guide.html#dependencies
Answered By - Logain
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.