xamarin/Xamarin.Forms

[Bug] CollectionViewRenderer, Control under iOS not of type UICollectionView

Offen

#6.325 geöffnet am 28.05.2019

 (5 Kommentare) (3 Reaktionen) (0 zugewiesene Personen)C# (1.926 Forks)batch import
a/collectionviewa/customrenderera/docse/6 :clock6:help wantedp/iOS 🍎t/bug :bug:up-for-grabs

Repository-Metriken

Stars
 (5.644 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Description

According to the documentations https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/renderers#views Xamarin Forms' CollectionView should be of type UICollectionView under iOS. However when implementing a Customrenderer with the help of CollectionViewRenderer the Control is of type UICollectionViewControllerWrapperView. It is difficult or can just be done by tricks to get the actual UICollectionView to manipulate the rendering.

Steps to Reproduce

  1. Create a new Xamarin Forms app
  2. Create a class inheriting from CollectionView
  3. In the iOS project create a custom renderer inheriting from CollectionViewRenderer
  4. In the OnElementChanged (Or somewhere you want) print/see the type of Control

Expected Behavior

Control of an iOS CollectionViewRenderer is of type UICollectionView

Actual Behavior

Control of an iOSCollectionViewRenderer is of type UICollectionViewControllerWrapperView

Basic Information

  • Version with issue: Xamarin Forms 3.6.0.264807
  • Last known good version: /
  • IDE: Visual Studio for Mac Community 8.0.5 (build 9)
  • Platform Target Frameworks:
    • iOS: Target is 8.0, Device is 12.2

Links

Had a question on the Xamarin community about it already with two workarounds: https://forums.xamarin.com/discussion/156810/ios-collectionviewrenderer-get-uicollectionview#latest

Contributor Guide