From: seungho Date: Mon, 2 Nov 2020 08:48:11 +0000 (+0900) Subject: [NUI] fix ScrollableBase layout issue X-Git-Tag: accepted/tizen/unified/20210219.040944~301 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=233e0da526bb3d8b6e53d29b4dc0b6395dd3c11e;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] fix ScrollableBase layout issue - Rollback default ContentsContainer layout (AbsoluteLayout) - Set false the value of SetPositionByLayout of the AbsoluteLayout Signed-off-by: seungho --- diff --git a/src/Tizen.NUI.Components/Controls/ScrollableBase.cs b/src/Tizen.NUI.Components/Controls/ScrollableBase.cs index 509f692..dbbebf4 100755 --- a/src/Tizen.NUI.Components/Controls/ScrollableBase.cs +++ b/src/Tizen.NUI.Components/Controls/ScrollableBase.cs @@ -150,8 +150,8 @@ namespace Tizen.NUI.Components MeasureChildWithMargins(childLayout, unrestrictedMeasureSpec, new LayoutLength(0), heightMeasureSpec, new LayoutLength(0)); // Width unrestricted by parent } - totalWidth = childLayout.MeasuredWidth.Size.AsDecimal(); - totalHeight = childLayout.MeasuredHeight.Size.AsDecimal(); + totalWidth = (childLayout.MeasuredWidth.Size + (childLayout.Padding.Start + childLayout.Padding.End)).AsDecimal(); + totalHeight = (childLayout.MeasuredHeight.Size + (childLayout.Padding.Top + childLayout.Padding.Bottom)).AsDecimal(); if (childLayout.MeasuredWidth.State == MeasuredSize.StateType.MeasuredSizeTooSmall) { @@ -243,8 +243,8 @@ namespace Tizen.NUI.Components mPanGestureDetector.AddDirection(value == Direction.Horizontal ? PanGestureDetector.DirectionHorizontal : PanGestureDetector.DirectionVertical); - ContentContainer.WidthSpecification = LayoutParamPolicies.WrapContent; - ContentContainer.HeightSpecification = LayoutParamPolicies.WrapContent; + ContentContainer.WidthSpecification = ScrollingDirection == Direction.Vertical ? LayoutParamPolicies.MatchParent : LayoutParamPolicies.WrapContent; + ContentContainer.HeightSpecification = ScrollingDirection == Direction.Vertical ? LayoutParamPolicies.WrapContent : LayoutParamPolicies.MatchParent; } } } @@ -435,7 +435,7 @@ namespace Tizen.NUI.Components ContentContainer.Layout = value; if (ContentContainer.Layout != null) { - ContentContainer.Layout.SetPositionByLayout = true; + ContentContainer.Layout.SetPositionByLayout = false; } } } @@ -606,11 +606,11 @@ namespace Tizen.NUI.Components ContentContainer = new View() { Name = "ContentContainer", - WidthSpecification = LayoutParamPolicies.WrapContent, - HeightSpecification = LayoutParamPolicies.WrapContent, - Layout = new LinearLayout() + WidthSpecification = ScrollingDirection == Direction.Vertical ? LayoutParamPolicies.MatchParent : LayoutParamPolicies.WrapContent, + HeightSpecification = ScrollingDirection == Direction.Vertical ? LayoutParamPolicies.WrapContent : LayoutParamPolicies.MatchParent, + Layout = new AbsoluteLayout() { - SetPositionByLayout = true + SetPositionByLayout = false }, }; ContentContainer.Relayout += OnScrollingChildRelayout;