Skip to content

Commit a3038d6

Browse files
Merge pull request #100 from syncfusion/Sathish-087-patch-1
Shimmer not adjusting for increased font size
2 parents 6ec32d1 + 811e06c commit a3038d6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

maui/src/Shimmer/SfShimmer.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,10 @@ protected override Size MeasureContent(double widthConstraint, double heightCons
484484
{
485485
if (child == Content)
486486
{
487-
Size contentSize = child.Measure(measuredSize.Width, measuredSize.Height);
487+
// When the height constraint or width constraint is not valid(infinite), we use double.PositiveInfinity to allow
488+
// the content to determine its own natural height or width without any restrictions.
489+
// This ensures that the content can lay out properly even when no specific height is provided by the parent.
490+
Size contentSize = child.Measure(isValidWidth ? measuredSize.Width : double.PositiveInfinity, isValidHeight ? measuredSize.Height : double.PositiveInfinity);
488491

489492
// If the returned content size is zero, the custom view or the shimmer drawable may not get rendered.
490493
// Because we are measuring the custom view or the shimmer drawable with the content size.
@@ -806,4 +809,4 @@ void IThemeElement.OnCommonThemeChanged(string oldTheme, string newTheme)
806809
#endregion
807810

808811
}
809-
}
812+
}

0 commit comments

Comments
 (0)