mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Merge branch 'ios-safe-area' of github.com:NativeScript/NativeScript into ios-safe-area
This commit is contained in:
@@ -106,6 +106,7 @@ export class LayoutBaseCommon extends CustomLayoutView implements LayoutBaseDefi
|
||||
}
|
||||
|
||||
public clipToBounds: boolean;
|
||||
public isPassThroughParentEnabled: boolean;
|
||||
|
||||
public _childIndexToNativeChildIndex(index?: number): number {
|
||||
if (index === undefined) {
|
||||
@@ -151,3 +152,6 @@ export class LayoutBaseCommon extends CustomLayoutView implements LayoutBaseDefi
|
||||
|
||||
export const clipToBoundsProperty = new Property<LayoutBaseCommon, boolean>({ name: "clipToBounds", defaultValue: true, valueConverter: booleanConverter });
|
||||
clipToBoundsProperty.register(LayoutBaseCommon);
|
||||
|
||||
export const isPassThroughParentEnabledProperty = new Property<LayoutBaseCommon, boolean>({ name: "isPassThroughParentEnabled", defaultValue: false, valueConverter: booleanConverter });
|
||||
isPassThroughParentEnabledProperty.register(LayoutBaseCommon);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {
|
||||
LayoutBaseCommon, clipToBoundsProperty,
|
||||
LayoutBaseCommon, clipToBoundsProperty, isPassThroughParentEnabledProperty,
|
||||
paddingLeftProperty, paddingTopProperty, paddingRightProperty, paddingBottomProperty, Length
|
||||
} from "./layout-base-common";
|
||||
|
||||
@@ -25,6 +25,10 @@ export class LayoutBase extends LayoutBaseCommon {
|
||||
console.warn(`clipToBounds with value false is not supported on Android. You can use this.android.getParent().setClipChildren(false) as an alternative`);
|
||||
}
|
||||
|
||||
[isPassThroughParentEnabledProperty.setNative](value: boolean) {
|
||||
(<any>this.nativeViewProtected).setPassThroughParent(value);
|
||||
}
|
||||
|
||||
[paddingTopProperty.getDefault](): Length {
|
||||
return { value: this._defaultPaddingTop, unit: "px" };
|
||||
}
|
||||
|
||||
8
tns-core-modules/ui/layouts/layout-base.d.ts
vendored
8
tns-core-modules/ui/layouts/layout-base.d.ts
vendored
@@ -96,6 +96,14 @@ export class LayoutBase extends CustomLayoutView {
|
||||
* Gets or sets a value indicating whether to clip the content of this layout.
|
||||
*/
|
||||
clipToBounds: boolean;
|
||||
|
||||
/**
|
||||
* Gets or sets a value indicating whether touch event should pass through to a parent view of the
|
||||
* layout container in case an interactive child view did not handle it.
|
||||
* Default value of this property is false. This does not affect the appearance of the view.
|
||||
*/
|
||||
isPassThroughParentEnabled: boolean;
|
||||
}
|
||||
|
||||
export const clipToBoundsProperty: Property<LayoutBase, boolean>;
|
||||
export const isPassThroughParentEnabledProperty: Property<LayoutBase, boolean>;
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { LayoutBaseCommon, clipToBoundsProperty, View, layout } from "./layout-base-common";
|
||||
import { ios as iosUtils } from "../../utils/utils";
|
||||
import {
|
||||
LayoutBaseCommon, clipToBoundsProperty, isPassThroughParentEnabledProperty, View
|
||||
} from "./layout-base-common";
|
||||
|
||||
export * from "./layout-base-common";
|
||||
|
||||
const majorVersion = iosUtils.MajorVersion;
|
||||
|
||||
export class LayoutBase extends LayoutBaseCommon {
|
||||
nativeViewProtected: UIView;
|
||||
|
||||
@@ -37,4 +36,8 @@ export class LayoutBase extends LayoutBaseCommon {
|
||||
[clipToBoundsProperty.setNative](value: boolean) {
|
||||
this._setNativeClipToBounds();
|
||||
}
|
||||
|
||||
[isPassThroughParentEnabledProperty.setNative](value: boolean) {
|
||||
(<any>this.nativeViewProtected).setPassThroughParent(value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user