android View未渲染时获得高度

ViewTreeObserver vto = tv.getViewTreeObserver();
            vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
                public void onGlobalLayout() {
                    
                    heigh = appDescription.getHeight();
                    
                    tv.getViewTreeObserver().removeGlobalOnLayoutListener(this);
                }
            });
原文地址:https://www.cnblogs.com/netcorner/p/4930391.html