@@ -591,6 +591,47 @@ public void ContractionAppliedEquallyOnMultiStarRows()
591
591
Assert . That ( column0Height , Is . EqualTo ( column1Height / 2 ) ) ;
592
592
}
593
593
594
+ [ Test ]
595
+ public void Issue13127 ( )
596
+ {
597
+ var scrollView = new ScrollView ( ) { IsPlatformEnabled = true } ;
598
+ var outerGrid = new Grid ( ) { RowSpacing = 0 , IsPlatformEnabled = true } ;
599
+ var outerStackLayout = new StackLayout ( ) { Spacing = 0 , IsPlatformEnabled = true } ;
600
+
601
+ var innerGrid = new Grid ( ) { RowSpacing = 0 , IsPlatformEnabled = true } ;
602
+ innerGrid . RowDefinitions = new RowDefinitionCollection ( ) {
603
+ new RowDefinition ( ) { Height = new GridLength ( 6 , GridUnitType . Star ) } ,
604
+ new RowDefinition ( ) { Height = new GridLength ( 4 , GridUnitType . Star ) } ,
605
+ } ;
606
+
607
+ // Set up the background view, only covers the first row
608
+ var background = new BoxView ( ) { IsPlatformEnabled = true } ;
609
+ Grid . SetRowSpan ( background , 1 ) ;
610
+
611
+ // Create the foreground, which spans both rows
612
+ var foreground = new StackLayout ( ) { Spacing = 0 , IsPlatformEnabled = true } ;
613
+ var view1 = new FixedSizeLabel ( new Size ( 200 , 50 ) ) { IsPlatformEnabled = true } ;
614
+ var view2 = new FixedSizeLabel ( new Size ( 200 , 100 ) ) { IsPlatformEnabled = true } ;
615
+ foreground . Children . Add ( view1 ) ;
616
+ foreground . Children . Add ( view2 ) ;
617
+ Grid . SetRowSpan ( foreground , 2 ) ;
618
+
619
+ innerGrid . Children . Add ( background ) ;
620
+ innerGrid . Children . Add ( foreground ) ;
621
+
622
+ outerStackLayout . Children . Add ( innerGrid ) ;
623
+ outerGrid . Children . Add ( outerStackLayout ) ;
624
+ scrollView . Content = outerGrid ;
625
+
626
+ var sizeRequest = scrollView . Measure ( 500 , 1000 ) ;
627
+ scrollView . Layout ( new Rectangle ( 0 , 0 , sizeRequest . Request . Width , 1000 ) ) ;
628
+
629
+ Assert . That ( innerGrid . Height , Is . EqualTo ( foreground . Height ) ) ;
630
+ Assert . That ( background . Height , Is . EqualTo ( foreground . Height * 0.6 ) . Within ( 0.01 ) ) ;
631
+
632
+ Assert . That ( background . Height , Is . EqualTo ( 165 ) ) ;
633
+ }
634
+
594
635
abstract class TestLabel : Label
595
636
{
596
637
protected TestLabel ( )
0 commit comments