diff --git a/tns-core-modules/ui/core/view/view.ios.ts b/tns-core-modules/ui/core/view/view.ios.ts index 15c1d9c11..911419367 100644 --- a/tns-core-modules/ui/core/view/view.ios.ts +++ b/tns-core-modules/ui/core/view/view.ios.ts @@ -256,13 +256,13 @@ export class View extends ViewCommon { return { left, right, top, bottom }; } - public getFrameFromPosition(position: { left, top, right, bottom }, insets?: { left, top }): CGRect { - insets = insets || { left: 0, top: 0 }; + public getFrameFromPosition(position: { left, top, right, bottom }, insets?: { left, top, right, bottom }): CGRect { + insets = insets || { left: 0, top: 0, right: 0, bottom: 0 }; const left = layout.round(layout.toDeviceIndependentPixels(position.left + insets.left)); const top = layout.round(layout.toDeviceIndependentPixels(position.top + insets.top)); - const width = layout.round(layout.toDeviceIndependentPixels(position.right - position.left)); - const height = layout.round(layout.toDeviceIndependentPixels(position.bottom - position.top)); + const width = layout.round(layout.toDeviceIndependentPixels(position.right - position.left - insets.left - insets.right)); + const height = layout.round(layout.toDeviceIndependentPixels(position.bottom - position.top - insets.top - insets.bottom)); return CGRectMake(left, top, width, height); }