maui
maui copied to clipboard
[Android] RefreshView doesn't size itself correctly
Description
I have a RefreshView in a grid which 2nd row height is *. The RefreshView should fill the entire remaining space, whereas it is constrained by its children size.
With RefreshView

Result 😞
With commented RefreshView

Result 😄
Steps to Reproduce
launch the sample here on Android: https://github.com/roubachof/Sharpnado.TaskLoaderView/tree/master/Retronado.Maui
Navigate to "Commands/Snackbar" page.
Version with bug
6.0.408 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android
Did you find any workaround?
No response
Relevant log output
No response
Perhaps related, I'm finding on RC2 that the RefreshView as root of the ContentPage or within a root Grid will not take up the full width of the page. iOS is fine.

I have a similiar scenario where I want the RefreshView to occupy the entire screen. But as of v7.0 it only occupies the size of it's children. Luckily one can play about with the arrangement code.
/// <summary>
/// [Android] RefreshView doesn't size itself correctly
/// https://github.com/dotnet/maui/issues/9008
/// </summary>
public sealed class RefreshViewFix : RefreshView
{
protected override SizeRequest OnMeasure(double widthConstraint, double heightConstraint)
{
#if ANDROID
return new SizeRequest(new Size(widthConstraint, heightConstraint));
#else
return base.OnMeasure(widthConstraint, heightConstraint);
#endif
}
}
Hi @roubachof,
Can you try to repro this again with .NET 7?
Thank you, James