如何算出一个组件在屏幕中的坐标?
#968
|
如何算出一个组件在屏幕中的坐标? |
Answered by
wwwcg
Apr 2, 2026
Replies: 1 comment
|
可用 convertFrame API转换,这部分我们将在文章中补充详细说明 |
0 replies
Answer selected by
wwwcg
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
可用 convertFrame API转换,这部分我们将在文章中补充详细说明
/**
* 转换当前坐标到目标节点坐标系
* @PARAM frame 当前view坐标系的坐标位置
* @PARAM toView 相对目标节点View坐标系( 如toView为null,则默认为当前Pager)
* @return 转换到toView坐标系的坐标位置
* 注:转换过程忽略transform设值
/
fun convertFrame(frame: Frame, toView: ViewContainer<, *>?): Frame