您的位置: 首页 > 文章 > Android View api 详解 - getLeft , getTop, getBottom, getRight Android View api 详解 - getLeft , getTop, getBottom, getRight 分类: 文章 • 2025-03-10 08:03:46 概述 掌握getLeft , getTop, getBottom, getRight的关键点:他们的取值是相对于父View的相对位置,单位是dx 注意:以上方法在OnCreate方法中调用,都会返回0,这是因为View还未加载完毕;本文点击计算之后才开始获取View的getLeft , getTop, getBottom, getRight值。 源码点击此处下载