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

Method applySafeAreaInsets

packages/core/ui/core/view/index.ios.ts:318–332  ·  view source on GitHub ↗
(frame: CGRect)

Source from the content-addressed store, hash-verified

316 }
317
318 protected applySafeAreaInsets(frame: CGRect): CGRect {
319 if (!__VISIONOS__ && SDK_VERSION <= 10) {
320 return null;
321 }
322 if (this.iosIgnoreSafeArea) {
323 return frame;
324 }
325 if (!this.iosOverflowSafeArea || !this.iosOverflowSafeAreaEnabled) {
326 return IOSHelper.shrinkToSafeArea(this, frame);
327 } else if (this.nativeViewProtected && this.nativeViewProtected.window) {
328 return IOSHelper.expandBeyondSafeArea(this, frame);
329 }
330
331 return null;
332 }
333
334 public getSafeAreaInsets(): Position {
335 const safeAreaInsets = this.nativeViewProtected && this.nativeViewProtected.safeAreaInsets;

Callers 1

Calls 2

shrinkToSafeAreaMethod · 0.80
expandBeyondSafeAreaMethod · 0.80

Tested by

no test coverage detected