xamarin/Xamarin.Forms

[Bug] iOS collection view items are misaligned with background

オープン

#8,719 opened on 2019/11/29

 (4 件のコメント) (0 件のリアクション) (0 人の担当者)C# (1,926 件のフォーク)batch import
a/collectionviewe/2 :clock2:good first issuehelp wantedinactivep/iOS 🍎t/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

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

コントリビューターガイド