获取元素当前位置?

Jan*_*ter 2 nativescript nativescript-angular

有没有办法获取元素的当前位置?它是 x 和 y。我试过了getLocationOnScreengetLocationInWindow但结果未定义。

小智 6

我认为getLocationOnScreengetLocationInWindow应该是对象,getLocationOnScreen().x 否则.y 就可以了。