xamarin/Xamarin.Forms

[Bug] iOS collection view items are misaligned with background

Offen

#8.719 geöffnet am 29.11.2019

 (4 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C# (1.926 Forks)batch import
a/collectionviewe/2 :clock2:good first issuehelp wantedinactivep/iOS 🍎t/bug :bug:up-for-grabs

Repository-Metriken

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

Beschreibung

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

Contributor Guide