What event is fired after all views are fully drawn?
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. The开发者_如何学运维re 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.
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.
精彩评论