xamarin/Xamarin.Forms

[Bug] Empty iOS ViewCell label does not update

开放

#6,118 创建于 2019年5月7日

 (2 条评论) (0 个反应) (0 位负责人)C# (1,926 个派生)batch import
a/listviewe/4 :clock4:help wantedp/iOS 🍎t/bug :bug:up-for-grabs

仓库指标

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

描述

Description

I have a Label in a ViewCell. The label Text property is not immediately initialized, but is set shortly after creation by a view-model binding. On iOS, both in the simulator and on the device, the Label remains empty even after the binding has updated Text with a value.

  • If the Label is initially populated with a value (e.g. " " a string containing a space), everything works fine
  • Everything works fine on Android

Steps to Reproduce

I've attached a sample that populates a ListView with cells which update their label every second. So they start out empty, and then after a second a value should appear.

  1. Run the attached sample on an iOS device or simulator; the table will appear empty.
  2. Uncomment ItemViewModel.cs line 14 and run the sample again; values will now appear in the table after a one second delay.

Expected Behavior

Values should appear in the table without having to set an initial value on the label's Text property.

Actual Behavior

Nothing will appear in the label unless you set an initial value.

Basic Information

  • Version with issue: 3.6.0.264807
  • Last known good version: (none)
  • IDE: Visual Studio for Mac v8.0.5 (build 9)
  • Platform Target Frameworks: Xamarin.Forms
    • iOS: 12.2
    • Android: API 27
    • UWP: n/a
  • Android Support Library Version: 28.0.0.1
  • Nuget Packages: Xamarin.Forms
  • Affected Devices: iOS device and simulator

Reproduction Link

iOSViewCellBugCase.zip

贡献者指南