From 0dadbd473e16976db9060dae552dc591c2ca681b Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Fri, 15 Oct 2021 10:56:52 +0800 Subject: [PATCH] android: if scroller's child is most width,then its width should be equal to scroller's width --- .../doric/src/main/java/pub/doric/widget/HVScrollView.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doric-android/doric/src/main/java/pub/doric/widget/HVScrollView.java b/doric-android/doric/src/main/java/pub/doric/widget/HVScrollView.java index 6d71b476..283a45bb 100644 --- a/doric-android/doric/src/main/java/pub/doric/widget/HVScrollView.java +++ b/doric-android/doric/src/main/java/pub/doric/widget/HVScrollView.java @@ -543,15 +543,15 @@ public class HVScrollView extends FrameLayout implements NestedScrollingParent, int childWidthMeasureSpec; int childHeightMeasureSpec; final FrameLayout.LayoutParams lp = (LayoutParams) child.getLayoutParams(); - - if (child.getMeasuredWidth() < width && lp.width == ViewGroup.LayoutParams.MATCH_PARENT) { + + if (lp.width == ViewGroup.LayoutParams.MATCH_PARENT) { childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY); } else { widthMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); childWidthMeasureSpec = getChildMeasureSpec(widthMeasureSpec, getPaddingLeft() + getPaddingRight(), lp.width); } - if (child.getMeasuredHeight() < height && lp.height == ViewGroup.LayoutParams.MATCH_PARENT) { + if (lp.height == ViewGroup.LayoutParams.MATCH_PARENT) { childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY); } else { heightMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);