view.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
viewHeight= visibleOpenBtn.getMeasuredHeight();
viewWidth= visibleOpenBtn.getMeasuredWidth();
/**
* Calculate actual width height of views
*/
Final ViewTreeObserver observer = view.getViewTreeObserver();
observer.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
viewWidth = view.getWidth();
}
});
No comments:
Post a Comment