mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
Fix: Background not re-drawing on android
This commit is contained in:
@ -47,7 +47,9 @@ export module ad {
|
||||
&& isNullOrUndefined(background.image)
|
||||
&& !isNullOrUndefined(background.color)) {
|
||||
let backgroundColor = (<any>backgroundDrawable).backgroundColor = background.color.android;
|
||||
backgroundDrawable.mutate();
|
||||
backgroundDrawable.setColorFilter(backgroundColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
backgroundDrawable.invalidateSelf(); // Make sure the drawable is invalidated. Android forgets to invalidate it in some cases: toolbar
|
||||
(<any>backgroundDrawable).backgroundColor = backgroundColor;
|
||||
}
|
||||
else if (!background.isEmpty()) {
|
||||
|
Reference in New Issue
Block a user