xamarin/Xamarin.Forms

[Bug] iOS collection view items are misaligned with background

Ouverte

#8 719 ouverte le 29 nov. 2019

 (4 commentaires) (0 réaction) (0 personne assignée)C# (1 926 forks)batch import
a/collectionviewe/2 :clock2:good first issuehelp wantedinactivep/iOS 🍎t/bug :bug:up-for-grabs

Métriques du dépôt

Stars
 (5 644 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

Description

On iOS, it's not possible to align content with the collection view item background, if a background colour is set.

This image for an example of what I mean:

This was produced with this Xaml:

This is only an issue on iOS, not on Android.

I've included a renderer in the iOS solution that hacks a fix in for this. After the fix, the item is displayed correctly:

I believe the issue is caused by the fact that the rendered content is given a bounds with an x of -1 and a y of -1.

Steps to Reproduce

Run the app

Expected Behavior

Background and accent are aligned

Actual Behavior

Background and accent are misaligned

Uncomment out the renderer attribute on iOS to see a hack that works around the bug

Basic Information

  • Version with issue:
  • Last known good version:
  • IDE: Visual Studio for Mac
  • Platform Target Frameworks:
    • iOS: 13.6.0.12
  • Nuget Packages: Xamarin Forms 4.3.0.991211
  • Affected Devices: iOS

Reproduction Link

https://github.com/petermajor/CollectionViewItemAlignmentBug

Guide contributeur