MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / getSafeAreaInsets

Method getSafeAreaInsets

packages/core/ui/core/view/index.ios.ts:334–348  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

332 }
333
334 public getSafeAreaInsets(): Position {
335 const safeAreaInsets = this.nativeViewProtected && this.nativeViewProtected.safeAreaInsets;
336 const insets = { left: 0, top: 0, right: 0, bottom: 0 };
337 if (this.iosIgnoreSafeArea) {
338 return insets;
339 }
340 if (safeAreaInsets) {
341 insets.left = layout.round(layout.toDevicePixels(safeAreaInsets.left));
342 insets.top = layout.round(layout.toDevicePixels(safeAreaInsets.top));
343 insets.right = layout.round(layout.toDevicePixels(safeAreaInsets.right));
344 insets.bottom = layout.round(layout.toDevicePixels(safeAreaInsets.bottom));
345 }
346
347 return insets;
348 }
349
350 public override _setDefaultPaddings(insets: any): void {
351 if (insets instanceof UIEdgeInsets) {

Callers 15

onLayoutMethod · 0.80
onLayoutMethod · 0.80
onLayoutMethod · 0.80
onLayoutMethod · 0.80
onLayoutMethod · 0.80
onLayoutMethod · 0.80
onLayoutMethod · 0.80
onLayoutMethod · 0.80
onLayoutMethod · 0.80
shrinkToSafeAreaMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected