Files
2019-06-26 15:13:48 +03:00

43 lines
1.1 KiB
TypeScript

import {
LayoutBaseCommon, clipToBoundsProperty, isPassThroughParentEnabledProperty, View
} from "./layout-base-common";
export * from "./layout-base-common";
export class LayoutBase extends LayoutBaseCommon {
nativeViewProtected: UIView;
public addChild(child: View): void {
super.addChild(child);
this.requestLayout();
}
public insertChild(child: View, atIndex: number): void {
super.insertChild(child, atIndex);
this.requestLayout();
}
public removeChild(child: View): void {
super.removeChild(child);
this.requestLayout();
}
_setNativeClipToBounds() {
if (this.clipToBounds) {
this.nativeViewProtected.clipsToBounds = true;
} else {
super._setNativeClipToBounds();
}
}
[clipToBoundsProperty.getDefault](): boolean {
return false;
}
[clipToBoundsProperty.setNative](value: boolean) {
this._setNativeClipToBounds();
}
[isPassThroughParentEnabledProperty.setNative](value: boolean) {
(<any>this.nativeViewProtected).setPassThroughParent(value);
}
}