mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
@ -5,6 +5,8 @@ import dependencyObservable = require("ui/core/dependency-observable");
|
|||||||
import proxy = require("ui/core/proxy");
|
import proxy = require("ui/core/proxy");
|
||||||
import utils = require("utils/utils");
|
import utils = require("utils/utils");
|
||||||
import style = require("ui/styling/style");
|
import style = require("ui/styling/style");
|
||||||
|
import * as platformModule from "platform";
|
||||||
|
var platform: typeof platformModule;
|
||||||
|
|
||||||
export class LayoutBase extends view.CustomLayoutView implements definition.LayoutBase, view.AddChildFromBuilder {
|
export class LayoutBase extends view.CustomLayoutView implements definition.LayoutBase, view.AddChildFromBuilder {
|
||||||
|
|
||||||
@ -119,17 +121,19 @@ export class LayoutBase extends view.CustomLayoutView implements definition.Layo
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected onClipToBoundsChanged(oldValue: boolean, newValue: boolean) {
|
protected onClipToBoundsChanged(oldValue: boolean, newValue: boolean) {
|
||||||
var nativeView = this._nativeView;
|
if (!this._nativeView) {
|
||||||
if (!nativeView) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nativeView instanceof UIView) {
|
if (!platform) {
|
||||||
nativeView.clipsToBounds = newValue;
|
platform = require("platform");
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (nativeView instanceof android.view.ViewGroup) {
|
if (platform.device.os === platform.platformNames.ios) {
|
||||||
nativeView.setClipChildren(newValue);
|
this._nativeView.clipsToBounds = newValue;
|
||||||
|
}
|
||||||
|
else if (platform.device.os === platform.platformNames.android) {
|
||||||
|
this._nativeView.setClipChildren(newValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user