Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] [iOS] RefreshView draws behind CollectionView Header #8282

Closed
janschoelchAtOK opened this issue Oct 29, 2019 · 28 comments · Fixed by #13773
Closed

[Bug] [iOS] RefreshView draws behind CollectionView Header #8282

janschoelchAtOK opened this issue Oct 29, 2019 · 28 comments · Fixed by #13773
Assignees
Labels
a/collectionview a/refreshview 🔄 blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. e/3 🕒 3 in-progress This issue has an associated pull request that may resolve it! m/high impact ⬛ p/iOS 🍎 t/bug 🐛

Comments

@janschoelchAtOK
Copy link

Description

When using a RefreshView and wrap a CollectionView with header in it, the RefreshView draws behind the CollectionView header on iOS.
This leads to unwanted behaviour, for instance: CollectionView in some cases scrolls out of screen bounds (as it scrolls up too far after refreshing).

Steps to Reproduce

I just re-used and adjusted the Xamarin.Forms CollectionView Demo to reproduce the issue.

  1. Open the attached Solution
  2. Navigate to "Pull to Refresh using RefreshView -> Vertical List"
  3. Pull the CollectionView down to refresh

Expected Behavior

The RefreshView should draw above the CollectionView header.

Actual Behavior

The RefreshView draws behind the CollectionView header on iOS.

Basic Information

  • Version with issue: Tested on Xamarin.Forms 4.3.0.908675
  • Last known good version: N/A
  • IDE: Tested on Visual Studio Professional 2019
  • Platform Target Frameworks:
    • iOS: 11.0
    • Android: 9.0
    • UWP: N/A
  • Android Support Library Version: N/A
  • Nuget Packages: Xamarin.Forms 4.3.0.908675
  • Affected Devices: Tested on iPhone 8 running iOS 13.1.3 and Huawei P Smart + (2019) running Android 8.1.

Screenshots

The screencasts were made on Emulators (iPhone 8 iOS13, Google Nexus 5X Android 8.1).

iOS

OMMZ7DvVCg

Android

fmULH9FL7K

Reproduction Link

CollectionViewHeader.zip

@janschoelchAtOK janschoelchAtOK added s/unverified New report that has yet to be verified t/bug 🐛 labels Oct 29, 2019
@pauldipietro pauldipietro added this to New in Triage Oct 29, 2019
@jsuarezruiz jsuarezruiz added a/collectionview p/iOS 🍎 e/3 🕒 3 and removed s/unverified New report that has yet to be verified labels Oct 29, 2019
@jsuarezruiz jsuarezruiz added this to Backlog in CollectionView via automation Oct 29, 2019
@jsuarezruiz jsuarezruiz removed this from New in Triage Oct 29, 2019
@rmayrink
Copy link

Same issue here on iOS. CollectionView with Header and RefreshView.

@memsranga
Copy link
Contributor

I think the proper wording should be Header drawn above refreshview.
The same occurs for empty view also #7457

@huyjack178
Copy link

huyjack178 commented Nov 5, 2019

What is the progress of this issue? My project can not be completed because of this bug

@Flaviocrtt
Copy link

Same problem here, it makes space for activity indicator on the top of all, but it appears ignoring the header.

@jsauve
Copy link

jsauve commented Dec 12, 2019

I am also experiencing this in 4.4.0.991220-pre3. I have a large header at the top of my CollectionView. The CollectionView element is the root element of my ContentPage.Content. When performing a pull-to-refresh gesture, the RefreshView's ActivityIndicator is rendered above (y-axis) the CollectionView's "cells" and below (y-axis) the CollectionView's Header.

Since the point of using Header is for above-collection-view-cells content (per Jason Smith's Evolve 2016 talk), and because that implicitly suggests that CollectionView will be used as the root element of a page, then I would expect RefreshView's ActivityIndicator control to render above the CollectionView Header (above (y-axis) the outermost UI element of CollectionView).

Issue present on both iOS and Android.

My workaround will be to use an absolutely positioned ActivityIndicator of my own over (z-axis) the CollectionView to indicate loading activity. This is not ideal since I'd prefer to maintain UX consistency by taking advantage of RefreshView, but in its current rendering implementation, I won't be able to do that.

@jsauve
Copy link

jsauve commented Dec 12, 2019

I'll try to take a look at the existing renderer, make a fix, and submit a PR.

@raver99
Copy link

raver99 commented Feb 4, 2020

Because I needed this to work, I came up with a workaround that does the job, at least for my project.

It involves replicating the RefreshViewRenderer, adding some Xamarin Forms internal helper methods (just a few, really) and adding one line to fix it.
The fix is extending the bounds of the UIRefreshView with content offset of the scrollviewer.

I didn't really have the time to investigate all the layouting that happens here, I suspect some Autolayout constraints.
Extending the bounds is one way to fix it, probably not the real fix of the issue.

Here is the gist of my workaround
You can find it by looking at the "todo"

Hope it helps

@LuoyeAn
Copy link
Contributor

LuoyeAn commented Apr 14, 2020

Hi everyone, any soultion here? I got the same issue.

@jamesmontemagno
Copy link
Contributor

Same here today, it looks just as if the RefreshView is being added to the main CollectionView content and not including the Header above it.

@daniVerz
Copy link

Same here! Funny that after any minor change and Hot Reload it renders the header right.
Any hope? I have to release a new version...

@xleon
Copy link

xleon commented Aug 12, 2020

Same here with XF 4.7.0.1260. RefreshView is not usable in iOS with a Header.
More problems (artefacts) come into place when the page does not use a Navigation bar (NavigationPage.HasNavigationBar="False")

@samhouts samhouts added this to the 5.0.0 milestone Aug 13, 2020
@samhouts samhouts added this to To do in vNext+1 (5.0.0) Aug 14, 2020
@samhouts samhouts removed this from the 5.0.0 milestone Nov 2, 2020
@alexmartinezm
Copy link

C'mon guys, we can have this fixed before MAUI, can't we?

@xamiell
Copy link

xamiell commented Nov 26, 2020

Having the Same problem.

Xamarin.Forms 4.8.0.1560
Visual Studio for Mac 8.8 build 2913

@luismts
Copy link

luismts commented Dec 1, 2020

This is kind of annoying. Is there a workaround at least?

cc @hartez @jsuarezruiz @rmarinho

@jsuarezruiz jsuarezruiz self-assigned this Dec 1, 2020
@xamiell
Copy link

xamiell commented Dec 8, 2020

Hi, any update?

@giuseppenovielli
Copy link

giuseppenovielli commented Dec 16, 2020

Same problem, please fix it. I can't use CollectionView with header and still using ListView!!!! Please prioritize!!

@jsuarezruiz Please prioritize this bug, is very blocker, i can't use CollectionView!

Thanks!!

@Nelo-cool
Copy link

Nelo-cool commented Dec 29, 2020

Because I needed this to work, I came up with a workaround that does the job, at least for my project.

It involves replicating the RefreshViewRenderer, adding some Xamarin Forms internal helper methods (just a few, really) and adding one line to fix it.
The fix is extending the bounds of the UIRefreshView with content offset of the scrollviewer.

I didn't really have the time to investigate all the layouting that happens here, I suspect some Autolayout constraints.
Extending the bounds is one way to fix it, probably not the real fix of the issue.

Here is the gist of my workaround
You can find it by looking at the "todo"

Hope it helps

Thanks! This is a workaround. it really works!

@Outtake
Copy link

Outtake commented Feb 8, 2021

How is this not fixed yet? Would really like to start using collectionview any time soon.
Sadly the workaround from @raver99 doesn't work for me.

@xamiell
Copy link

xamiell commented Feb 9, 2021

@Outtake same here, doesn't work for me too.
Production apps :'(

@giuseppenovielli
Copy link

giuseppenovielli commented Feb 9, 2021

@jsuarezruiz @hartez @samhouts i can't use CollectionView with header with this bug!! Please give also only a feedback. Thanks! Collectionview is great! I love horizontal, grid, vertical layout all into one API 😃

@jsuarezruiz jsuarezruiz added the blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. label Feb 9, 2021
hartez added a commit that referenced this issue Feb 11, 2021
@jsuarezruiz jsuarezruiz moved this from Review Backlog to In Progress in CollectionView Feb 16, 2021
@jsuarezruiz jsuarezruiz added the in-progress This issue has an associated pull request that may resolve it! label Feb 16, 2021
@jsuarezruiz
Copy link
Contributor

jsuarezruiz commented Feb 16, 2021

The issue will be fixed by #13773
I have marked it as an important fix to consider to include in the next release.

@Outtake
Copy link

Outtake commented Feb 16, 2021

@jsuarezruiz thanks

@giuseppenovielli
Copy link

@jsuarezruiz
Thank you so much!! Perfect!! :)

@xamiell
Copy link

xamiell commented Mar 3, 2021

Thanks @jsuarezruiz!

@matteovelati
Copy link

Is this bug solved? I'm having the same problem

@giuseppenovielli
Copy link

giuseppenovielli commented Jun 26, 2021

@matteovelati yes there is a pullrequest, thanks @jsuarezruiz, but must be added to a new xamarin.forms' release.

@matteovelati
Copy link

@giuseppenovielli is there a way to include the fix in my project in the meanwhile?

@giuseppenovielli
Copy link

giuseppenovielli commented Jun 26, 2021

@matteovelati check this pullrequest

https://github.com/xamarin/Xamarin.Forms/pull/13773/files

Clone Xamarin.Forms github project and edit manually files update by pullrequest

Use your Xamarin.Forms local clone, with bug fixed to build your app.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/collectionview a/refreshview 🔄 blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. e/3 🕒 3 in-progress This issue has an associated pull request that may resolve it! m/high impact ⬛ p/iOS 🍎 t/bug 🐛
Projects