Android中在OnCreate时获得控件高度
ViewTreeObserver vto = mArrowUp.getViewTreeObserver();
vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
mArrowUp.getViewTreeObserver().removeGlobalOnLayoutListener(this);
Log.e("Width",Integer.toString(mArrowUp.getWidth()));
}
});
摘自 欧阳天涵的专栏
补充:移动开发 , Android ,