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
![image](https://user-images.githubusercontent.com/596903/181053266-be95c454-8b44-41c1-955e-aa945fea1e16.png)
Result 😞
With commented RefreshView
![image](https://user-images.githubusercontent.com/596903/181053605-7e0cd4bc-8c9a-4c5e-be31-621f969ca07a.png)
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.
![image](https://user-images.githubusercontent.com/41873/197435767-17049148-3cdb-43e9-ad33-3020c68d95a1.png)
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