android - 获取 View 在 FrameLayout 中的位置
问题描述
我有一个FrameLayout
,我在其中放置了View
一个Gravity.CENTER_VERTICAL
。我需要获取 this 的左侧和顶部位置View
,相对于FrameLayout
. 我试过了,myView.top
但它给出了 0,虽然这是不正确的。那么,我怎样才能得到FrameLayout
孩子的位置呢?
解决方案
推荐阅读
- java - Deadbolt play framework 2.8 和动态约束
- visual-studio-code - 如何在 Mac 上完全卸载 Visual Studio Code
- php - 将模型数组传递给路由以从控制器显示在视图中
- reactjs - 404 添加 webpack 后无法 POST React Form
- c# - NuGet - 包 dll 未复制到输出目录
- javascript - 在加载页面上隐藏元素并在点击时显示它
- python - 为什么当我重新运行代码时我的网络图的节点总是四处移动
- opencv - OpenCV,C++,索引颜色通道问题
- ios - UnsafeRawPointer 到 UnsafeMutableRawPointer
- c# - 选择项目组合框 XAML 时显示对象类型而不是值