mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
fix layer type recycling (#4574)
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
// Definitions.
|
||||
import { Point, CustomLayoutView as CustomLayoutViewDefinition, dip } from ".";
|
||||
import { GestureTypes, GestureEventData } from "../../gestures";
|
||||
import { CacheLayerType } from "../../../utils/utils";
|
||||
|
||||
// Types.
|
||||
import { Background, ad as androidBackground } from "../../styling/background";
|
||||
@ -17,6 +18,7 @@ import {
|
||||
rotateProperty, scaleXProperty, scaleYProperty, translateXProperty, translateYProperty,
|
||||
zIndexProperty, backgroundInternalProperty
|
||||
} from "../../styling/style-properties";
|
||||
|
||||
import { profile } from "../../../profiling";
|
||||
|
||||
export * from "./view-common";
|
||||
@ -485,6 +487,13 @@ export class View extends ViewCommon {
|
||||
const nativeView = this.nativeView;
|
||||
org.nativescript.widgets.ViewHelper.setBackground(nativeView, value);
|
||||
nativeView.setPadding(this._defaultPaddingLeft, this._defaultPaddingTop, this._defaultPaddingRight, this._defaultPaddingBottom);
|
||||
|
||||
(<any>nativeView).background = undefined;
|
||||
const cache = <CacheLayerType><any>nativeView;
|
||||
if (cache.layerType !== undefined) {
|
||||
cache.setLayerType(cache.layerType, null);
|
||||
cache.layerType = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user