From 233e0da526bb3d8b6e53d29b4dc0b6395dd3c11e Mon Sep 17 00:00:00 2001 From: seungho Date: Mon, 2 Nov 2020 17:48:11 +0900 Subject: [PATCH] [NUI] fix ScrollableBase layout issue - Rollback default ContentsContainer layout (AbsoluteLayout) - Set false the value of SetPositionByLayout of the AbsoluteLayout Signed-off-by: seungho --- src/Tizen.NUI.Components/Controls/ScrollableBase.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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; -- 2.7.4