mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
fix layer type recycling (#4574)
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
// Definitions.
|
// Definitions.
|
||||||
import { Point, CustomLayoutView as CustomLayoutViewDefinition, dip } from ".";
|
import { Point, CustomLayoutView as CustomLayoutViewDefinition, dip } from ".";
|
||||||
import { GestureTypes, GestureEventData } from "../../gestures";
|
import { GestureTypes, GestureEventData } from "../../gestures";
|
||||||
|
import { CacheLayerType } from "../../../utils/utils";
|
||||||
|
|
||||||
// Types.
|
// Types.
|
||||||
import { Background, ad as androidBackground } from "../../styling/background";
|
import { Background, ad as androidBackground } from "../../styling/background";
|
||||||
@ -17,12 +18,13 @@ import {
|
|||||||
rotateProperty, scaleXProperty, scaleYProperty, translateXProperty, translateYProperty,
|
rotateProperty, scaleXProperty, scaleYProperty, translateXProperty, translateYProperty,
|
||||||
zIndexProperty, backgroundInternalProperty
|
zIndexProperty, backgroundInternalProperty
|
||||||
} from "../../styling/style-properties";
|
} from "../../styling/style-properties";
|
||||||
|
|
||||||
import { profile } from "../../../profiling";
|
import { profile } from "../../../profiling";
|
||||||
|
|
||||||
export * from "./view-common";
|
export * from "./view-common";
|
||||||
|
|
||||||
interface TouchListener {
|
interface TouchListener {
|
||||||
new (owner: View): android.view.View.OnTouchListener;
|
new(owner: View): android.view.View.OnTouchListener;
|
||||||
}
|
}
|
||||||
|
|
||||||
let TouchListener: TouchListener;
|
let TouchListener: TouchListener;
|
||||||
@ -485,6 +487,13 @@ export class View extends ViewCommon {
|
|||||||
const nativeView = this.nativeView;
|
const nativeView = this.nativeView;
|
||||||
org.nativescript.widgets.ViewHelper.setBackground(nativeView, value);
|
org.nativescript.widgets.ViewHelper.setBackground(nativeView, value);
|
||||||
nativeView.setPadding(this._defaultPaddingLeft, this._defaultPaddingTop, this._defaultPaddingRight, this._defaultPaddingBottom);
|
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