首页 > 解决方案 > 获取 View 在 FrameLayout 中的位置

问题描述

我有一个FrameLayout,我在其中放置了View一个Gravity.CENTER_VERTICAL。我需要获取 this 的左侧和顶部位置View,相对于FrameLayout. 我试过了,myView.top但它给出了 0,虽然这是不正确的。那么,我怎样才能得到FrameLayout孩子的位置呢?

标签: androidandroid-framelayout

解决方案


推荐阅读