maui icon indicating copy to clipboard operation
maui copied to clipboard

[Android] RefreshView doesn't size itself correctly

Open roubachof opened this issue 2 years ago • 1 comments

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

Result 😞

Screenshot_1658850813

With commented RefreshView

image

Result 😄

Screenshot_1658850480

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

roubachof avatar Jul 26 '22 16:07 roubachof

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

davidortinau avatar Oct 24 '22 02:10 davidortinau

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
        }
    }

espenrl avatar Dec 05 '22 15:12 espenrl

Hi @roubachof,

Can you try to repro this again with .NET 7?

Thank you, James

japarson avatar Jun 15 '23 04:06 japarson