计算某个控件的高度

  ViewTreeObserver vto2 = mLayoutTitle.getViewTreeObserver();
        vto2.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
            @Override
            public void onGlobalLayout() {
                mLayoutTitle.getViewTreeObserver().removeGlobalOnLayoutListener(this);
                layoutTitleHeight = mLayoutTitle.getHeight();
            }
        });

猜你喜欢

转载自blog.csdn.net/qq_35674951/article/details/80196325
今日推荐