xamarin/Xamarin.Forms

Headless Layouts are causing crashing and graphics glitches in Cells

开放

#4,168 创建于 2018年10月22日

 (2 条评论) (0 个反应) (0 位负责人)C# (1,926 个派生)batch import
a/layoute/6 :clock6:help wantedi/highp/Androidup-for-grabs

仓库指标

星标
 (5,644 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Description

When I use a headless layout inside of a cell, it would cause a graphical glitch where the data that was previously in the cell would show up under or on top of the new data in the cell. This became a jumbled mess.

When I used more labels and an FFImageLoading CachedImage, it would just crash the app with the below exception. I should probably test this in iOS as well.

Removing the CompressedLayout.IsHeadless="True" fixes both problems.

Steps to Reproduce

  1. Create Custom ViewCell
  2. Use StackLayouts
  3. Add a label with bound data to the StackLayout
  4. Assign CompressedLayout.IsHeadless="True" to the StackLayout

Expected Behavior

For the application not to crash and display bound data in the cell.

Actual Behavior

When using ffimageloading cached images and formatted string, the application crashes with this exception:

Unhandled Exception:

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index occurred

When using just a basic label by itself, the previous use label used in that cell would appear over the new data in the label. It became a jumbled messed.

Basic Information

  • Version with issue: 3.3.0.912540
  • Last known good version:
  • IDE: Visual Studio 2017 15.8.7
  • Platform Target Frameworks:
    • iOS:
    • Android: 8.1 Oreo
    • UWP:
  • Android Support Library Version:
  • Nuget Packages: Xamarin.FFImageLoading.Forms 2.4.3.840
  • Affected Devices: Emulator

Screenshots

https://1drv.ms/u/s!AgoxySKwbTmmpq1aJioVGraINndXNA

Reproduction Link

https://gist.github.com/seansparkman/560624cba6608eaa25831e59fcee7c71

贡献者指南