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

Method getLocationOnScreen

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

Source from the content-addressed store, hash-verified

375 }
376
377 public getLocationOnScreen(): Point {
378 if (!this.nativeViewProtected || !this.nativeViewProtected.window) {
379 return undefined;
380 }
381
382 const pointInWindow = this.nativeViewProtected.convertPointToView(this.nativeViewProtected.bounds.origin, null);
383 const pointOnScreen = this.nativeViewProtected.window.convertPointToWindow(pointInWindow, null);
384
385 return {
386 x: pointOnScreen.x,
387 y: pointOnScreen.y,
388 };
389 }
390
391 public getLocationRelativeTo(otherView: View): Point {
392 if (!this.nativeViewProtected || !this.nativeViewProtected.window || !otherView.nativeViewProtected || !otherView.nativeViewProtected.window || this.nativeViewProtected.window !== otherView.nativeViewProtected.window) {

Calls

no outgoing calls

Tested by

no test coverage detected