mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Call native setters once when a page is instantiated. Fix background not being reset, Label's background is now set to background, not layer Make the nativeView field instead of property for performance reasons
23 lines
802 B
TypeScript
23 lines
802 B
TypeScript
import * as button from "tns-core-modules/ui/button";
|
|
import * as view from "tns-core-modules/ui/core/view";
|
|
|
|
export class Button extends button.Button {
|
|
nativeBackgroundRedraws = 0;
|
|
backgroundInternalSetNativeCount = 0;
|
|
fontInternalSetNativeCount = 0;
|
|
|
|
[view.backgroundInternalProperty.setNative](value) {
|
|
this.backgroundInternalSetNativeCount++;
|
|
return super[view.backgroundInternalProperty.setNative](value);
|
|
}
|
|
[view.fontInternalProperty.setNative](value) {
|
|
this.fontInternalSetNativeCount++;
|
|
return super[view.fontInternalProperty.setNative](value);
|
|
}
|
|
_redrawNativeBackground(value: any): void {
|
|
this.nativeBackgroundRedraws++;
|
|
super._redrawNativeBackground(value);
|
|
}
|
|
}
|
|
Button.prototype.recycleNativeView = false;
|