什么事件被触发后,所有的意见都充分界定呢? [英] What event is fired after all views are fully drawn?

查看:115
本文介绍了什么事件被触发后,所有的意见都充分界定呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要捕捉一些ImageViews的绝对位置作为放置目标的。我似乎无法找到我需要把我的code在读取画面,让左(有什么事件),上衣()..位置。我不想监控每个视图的通货膨胀。必须有某种onScreenFinsihed类型的事件,但我找不到它。 onMeasure和OnDraw中似乎火在他们的工作开始,我需要知道当他们完成。 TIA。

I need to capture the absolute positions of some ImageViews to use as drop targets. I can't seem to find what event I need to put my code in to read the screen and get the Left(), Top() .. positions. I do not want monitor the inflation of each individual view. There must be some sort of onScreenFinsihed type of event, but I can't find it. onMeasure and onDraw seem to fire at the start of their work, I need to know when they are done. TIA.

推荐答案

有没有这样的情况。你可以简单地发布一条消息/可运行在UI事件队列在绘图序列的开始有这个消息/ Runnable的执行绘制完成后(见View.post(Runnable接口)的实例。)此外,getLeft /共达返回测量和布局后,正确的值,你并不需要等待行将结束使用它们。

There is no such event. You can simply post a message/Runnable in the UI events queue at the beginning of a drawing sequence to have this message/Runnable executed after drawing is complete (see View.post(Runnable) for instance.) Also, getLeft/getTop return the correct value after measurement and layout, you don't need to wait for drawing to end to use them.

这篇关于什么事件被触发后,所有的意见都充分界定呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆