Skip to content

Commit

Permalink
Ensure an exact measure for the nested horizontal scrollview
Browse files Browse the repository at this point in the history
Fixes #13498
  • Loading branch information
hartez committed Feb 25, 2023
1 parent af6bdec commit 6f8fbeb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Core/src/Platform/Android/MauiScrollView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Android.Animation;
using Android.Content;
using Android.Graphics;
using Android.Hardware.Lights;
using Android.Runtime;
using Android.Util;
using Android.Views;
Expand Down Expand Up @@ -189,6 +190,10 @@ protected override void OnLayout(bool changed, int left, int top, int right, int

if (_hScrollView != null && _hScrollView.Parent == this)
{
var w = right - left;
var h = bottom - top;

_hScrollView.Measure(MeasureSpec.MakeMeasureSpec(w, MeasureSpecMode.Exactly), MeasureSpec.MakeMeasureSpec(h, MeasureSpecMode.Exactly));
_hScrollView.Layout(0, 0, right - left, bottom - top);
}

Expand Down

0 comments on commit 6f8fbeb

Please sign in to comment.