Skip to content

Commit

Permalink
修复 width height wrap_content padding margin 导致 的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
scwang90 committed Jun 7, 2020
1 parent 32d50b1 commit 2d788fb
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -609,11 +609,12 @@ protected void onMeasure(final int widthMeasureSpec,final int heightMeasureSpec)
((needPreview && showHeader) ? mHeaderHeight : 0) +
((needPreview && showFooter) ? mFooterHeight : 0), lp.height);
contentView.measure(widthSpec, heightSpec);
minimumWidth += contentView.getMeasuredWidth();
minimumHeight += contentView.getMeasuredHeight();
minimumWidth += contentView.getMeasuredWidth() + mlp.leftMargin + mlp.rightMargin;
minimumHeight += contentView.getMeasuredHeight() + mlp.topMargin + mlp.bottomMargin;
}
}

minimumWidth += thisView.getPaddingLeft() + thisView.getPaddingRight();
minimumHeight += thisView.getPaddingTop() + thisView.getPaddingBottom();
super.setMeasuredDimension(
View.resolveSize(minimumWidth, widthMeasureSpec),
View.resolveSize(minimumHeight, heightMeasureSpec));
Expand Down

0 comments on commit 2d788fb

Please sign in to comment.