terms: workaround issue with crashing ScrollableBase
authorLukasz Stanislawski <lukasz.stanislawski@gmail.com>
Wed, 17 Jun 2020 21:58:18 +0000 (23:58 +0200)
committerLukasz Stanislawski <lukasz.stanislawski@gmail.com>
Wed, 17 Jun 2020 21:58:18 +0000 (23:58 +0200)
Change-Id: I9fa623e2e5bd01a7099143bfdab45b0d683b1586

Oobe/Oobe.Terms/Views/TermsView.cs

index 87e163ee2f0a627a37a1c2ae169839ba63a45673..0fd994616c15ecc5b50f0521d6bb31c0e8b8c930 100644 (file)
@@ -63,6 +63,14 @@ namespace Oobe.Terms.Views
             scroller.Position2D = new Position2D(120, 136);
             scroller.Size2D = new Size2D(944, 268);
 
+            // workaround crash issue in ScrollableBase
+            var scrollerContent = new View
+            {
+                WidthResizePolicy = ResizePolicyType.FillToParent,
+                HeightResizePolicy = ResizePolicyType.FitToChildren,
+                Layout = new LinearLayout(),
+            };
+
             // Do not use style on content as it seriously impacts scrolling
             // performance on ScrollableBase
             TextLabel content = new TextLabel();
@@ -76,7 +84,8 @@ namespace Oobe.Terms.Views
             content.MultiLine = true;
             content.WidthResizePolicy = ResizePolicyType.FillToParent;
 
-            scroller.Add(content);
+            scrollerContent.Add(content);
+            scroller.Add(scrollerContent);
             scroller.ScrollEvent += (object sender, ScrollableBase.ScrollEventArgs args) =>
             {
                 if (IsScrolledToLastPage(sender as ScrollableBase))