mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
recycleNativeView filed now accepts: "always" | "never" | "auto". Always will recycle the nativeView no matter if its nativeView or android proprties are accessed. Never will disable recycling. Auto will recycle it only if nativeView and android properties are not accessed.
23 lines
916 B
TypeScript
23 lines
916 B
TypeScript
import { WrapLayoutBase, orientationProperty, itemWidthProperty, itemHeightProperty, Length } from "./wrap-layout-common";
|
|
|
|
export * from "./wrap-layout-common";
|
|
|
|
export class WrapLayout extends WrapLayoutBase {
|
|
nativeViewProtected: org.nativescript.widgets.WrapLayout;
|
|
|
|
public createNativeView() {
|
|
return new org.nativescript.widgets.WrapLayout(this._context);
|
|
}
|
|
|
|
[orientationProperty.setNative](value: "horizontal" | "vertical") {
|
|
this.nativeViewProtected.setOrientation(value === "vertical" ? org.nativescript.widgets.Orientation.vertical : org.nativescript.widgets.Orientation.horizontal)
|
|
}
|
|
|
|
[itemWidthProperty.setNative](value: Length) {
|
|
this.nativeViewProtected.setItemWidth(Length.toDevicePixels(value, -1));
|
|
}
|
|
|
|
[itemHeightProperty.setNative](value: Length) {
|
|
this.nativeViewProtected.setItemHeight(Length.toDevicePixels(value, -1));
|
|
}
|
|
} |