mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Disable recycling of native views
createNativeView will set iOS nativeView if it is null/undefined
This commit is contained in:
@@ -10,7 +10,7 @@ export class SliderBase extends View implements SliderDefinition {
|
||||
public maxValue: number;
|
||||
}
|
||||
|
||||
SliderBase.prototype.recycleNativeView = true;
|
||||
// SliderBase.prototype.recycleNativeView = true;
|
||||
|
||||
/**
|
||||
* Represents the observable property backing the value property of each Slider instance.
|
||||
|
||||
@@ -58,6 +58,7 @@ export class Slider extends SliderBase {
|
||||
}
|
||||
|
||||
public initNativeView(): void {
|
||||
super.initNativeView();
|
||||
const nativeView: any = this.nativeView;
|
||||
nativeView.listener.owner = this;
|
||||
}
|
||||
@@ -65,6 +66,7 @@ export class Slider extends SliderBase {
|
||||
public disposeNativeView() {
|
||||
const nativeView: any = this.nativeView;
|
||||
nativeView.listener.owner = null;
|
||||
super.disposeNativeView();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user