xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

[Bug] [iOS] [Regression] CollectionView with grouped Header and Footer Templates - No Gestures and extremely slow #14554

Open Zwawoo opened 3 years ago

Zwawoo commented 3 years ago

Description

I am using a grouped CollectionView with GroupHeaderTemplate and GroupFooterTemplate. In the group headers and footers are Buttons, which can't be tapped anymore as soon as the list gets scrolled. It seems like you cant interact with anything inside grouped headers and grouped footers after scrolling.

Additionally, when you add a grouped header, for example a simple label, the scroll performance gets very very bad. When i remove the grouped header, the scroll performance is normal again.

These two problems seems to be related as they occur together.

Xamarin Version 5.0.0.1931 is the last one where it works as expected. All future versions include these issues.

Android is working fine so that is just an issue on iOS.

Steps to Reproduce

  1. Create a grouped Collectionview with grouped header and grouped footer
  2. Inside the header or footer, place something to tap (for example a Button) which does something like open an alert
  3. Start app, open Page, click button -> everything is fine.
  4. Scroll the list and click the button again -> no reaction

Expected Behavior

Buttons etc. should react to tap

Actual Behavior

No reaction after tapping

Basic Information

Running on IPhone 7 with Hot Restart from a Windows machine.

Environment

Show/Hide Visual Studio info ``` Microsoft Visual Studio Community 2019 Version 16.11.2 VisualStudio.16.Release/16.11.2+31624.102 Microsoft .NET Framework Version 4.8.04084 Installierte Version: Community Visual C++ 2019 00435-60000-00000-AA029 Microsoft Visual C++ 2019 .NET Core Debugging with WSL 1.0 .NET Core Debugging with WSL Allgemeine Azure-Tools 1.10 Bietet allgemeine Dienste für die Verwendung durch Azure Mobile Services und Microsoft Azure-Tools. ASP.NET and Web Tools 2019 16.11.75.64347 ASP.NET and Web Tools 2019 ASP.NET Web Frameworks and Tools 2019 16.11.75.64347 Weitere Informationen finden Sie unter https://www.asp.net/. Azure App Service-Tools v3.0.0 16.11.75.64347 Azure App Service-Tools v3.0.0 Azure Functions and Web Jobs Tools 16.11.75.64347 Azure Functions and Web Jobs Tools C#-Tools 3.11.0-4.21403.6+ae1fff344d46976624e68ae17164e0607ab68b10 C#-Komponenten, die in der IDE verwendet werden. Abhängig von Ihrem Projekttyp und den zugehörigen Einstellungen kann eine andere Version des Compilers verwendet werden. Erweiterungen der Visual Studio-Containertools 1.0 Hiermit werden Container in Visual Studio angezeigt, verwaltet und diagnostiziert. Extensibility Message Bus 1.2.6 (master@34d6af2) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration. IntelliCode-Erweiterung 1.0 Detaillierte Informationen zur IntelliCode Visual Studio-Erweiterung Microsoft Azure-Tools für Visual Studio 2.9 Support für Azure Cloud Services-Projekte Microsoft Continuous Delivery Tools für Visual Studio 0.4 Die Konfiguration von Azure DevOps-Pipelines von der Visual Studio-IDE aus wird vereinfacht. Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers Microsoft Visual C++-Assistenten 1.0 Microsoft Visual C++-Assistenten Microsoft Visual Studio-Tools für Container 1.2 Jetzt können Sie Ihre ASP.NET Core-Anwendung in der Zielumgebung entwickeln, ausführen und überprüfen. Drücken Sie F5, um die Anwendung direkt in einem Container mit Debugfunktionen auszuführen, oder STRG+F5 zum Bearbeiten und Aktualisieren Ihrer Anwendung, ohne den Container erneut erstellen zu müssen. Mono Debugging for Visual Studio 16.10.15 (552afdf) Support for debugging Mono processes with Visual Studio. Node.js-Tools 1.5.30526.3 Commit Hash:c09c81113bcbc86d57943fcdd67e82434263d61d Fügt Unterstützung für das Entwickeln und Debuggen von Node.js-Apps in Visual Studio hinzu NuGet-Paket-Manager 5.11.0 NuGet-Paket-Manager in Visual Studio. Weitere Informationen zu NuGet finden Sie unter https://docs.nuget.org/. ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info Razor (ASP.NET Core) 16.1.0.2122504+13c05c96ea6bdbe550bd88b0bf6cdddf8cde1725 Provides languages services for ASP.NET Core Razor. SQL Server Data Tools 16.0.62107.28140 Microsoft SQL Server Data Tools TypeScript-Tools 16.0.30526.2002 TypeScript-Tools für Microsoft Visual Studio VC-Paket für Microsoft Visual Studio 1.0 VC-Paket für Microsoft Visual Studio Visual Basic-Tools 3.11.0-4.21403.6+ae1fff344d46976624e68ae17164e0607ab68b10 Visual Basic-Komponenten, die in der IDE verwendet werden. Abhängig von Ihrem Projekttyp und den zugehörigen Einstellungen kann eine andere Version des Compilers verwendet werden. Visual F# Tools 16.11.0-beta.21322.6+488cc578cafcd261d90d748d8aaa7b8b091232dc Microsoft Visual F# Tools Visual Studio-Tools für Container 1.0 Visual Studio-Tools für Container Visual Studio Code-Debugadapter-Hostpaket 1.0 Interopebene zum Hosten der Visual Studio Code-Adapter in Visual Studio VisualStudio.DeviceLog 1.0 Informationen zum Paket VisualStudio.Foo 1.0 Information about my package VisualStudio.Mac 1.0 Mac Extension for Visual Studio Xamarin 16.11.000.174 (d16-11@e8f56f1) Visual Studio-Erweiterung, um Entwicklung für Xamarin.iOS und Xamarin.Android zu ermöglichen. Xamarin Designer 16.11.0.17 (remotes/origin/11e0001f0b17269345e80b58fb3adf1ba4efe2cd@11e0001f0) Visual Studio-Erweiterung zum Aktivieren der Xamarin Designer-Tools in Visual Studio. Xamarin Templates 16.10.5 (355b57a) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms. Xamarin.Android SDK 11.4.0.5 (d16-11/7776c9f) Xamarin.Android Reference Assemblies and MSBuild support. Mono: c633fe9 Java.Interop: xamarin/java.interop/d16-11@48766c0 ProGuard: Guardsquare/proguard/v7.0.1@912d149 SQLite: xamarin/sqlite/3.35.4@85460d3 Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-11@683f375 Xamarin.iOS and Xamarin.Mac SDK 14.20.0.25 (3b53e529b) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support. ```
jsuarezruiz commented 3 years ago

Could you attach a small sample where reproduce the issue?. Tried to reproduce without success: Issue14554.zip

arscroggin commented 3 years ago

We are also seeing this issue in our app and have to downgrade to 5.0.0.1931. Hopefully @Zwawoo will provide a sample project to reproduce.

Zwawoo commented 3 years ago

@jsuarezruiz thank you for the sample I found out what is producing the issue. It is a Grid above the CollectionView with a row inside that has a height below "0.5". Just add

<Grid  RowSpacing="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"></ColumnDefinition>
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="50"></RowDefinition>
                <RowDefinition Height="0.2"></RowDefinition>
            </Grid.RowDefinitions>

            <Label Text="TitleLabel" LineBreakMode="TailTruncation"  TextColor="Black" MaxLines="1"
                   FontSize="20" VerticalOptions="Center" HorizontalTextAlignment="Center" HorizontalOptions="Center">
            </Label>

            <BoxView Grid.Row="1"  Color="Gray" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Margin="0"/>

        </Grid>

above the CollectionView in your example.

rafaltieto commented 2 years ago

I see that after 6 months this bug still not unverified and not assigned so let me provide some more info which, I hope, help you reproducing it:

I noticed that this bug appears when a CollectionView does not start from the top of page but from certain Y position (screen percentage?): ie 51 for iPhone 13 and 32 for iPhone7. Group header tap gestures stop working when group is scrolled out of visible area.

I’m attaching simple project that demonstrates this bug: GroupedCollectionViewBug.zip

I hope that this issue will be solved quickly as there’s not good workaround for it (downgrading XF to 5.0.0.1931 is not an option due to other XF bugs!)