Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要获取 Vlayout 的 offsetHeight,但直到我知道它已被绘制。我如何检查这个组件是否已绘制?
我如何检查这个组件是否已绘制?
您可以覆盖 Canvas 的 onDraw 方法并在那里添加一些自定义功能。
@Override protected void onDraw() { super.onDraw(); //your code }
或者,您可以向组件添加绘图处理程序:
addDrawHandler(new DrawHandler() { @Override public void onDraw(DrawEvent event) { //Do stuff } });