xamarin/Xamarin.Forms

[Bug] Empty iOS ViewCell label does not update

Open

#6,118 opened on May 7, 2019

 (2 comments) (0 reactions) (0 assignees)C# (1,926 forks)batch import
a/listviewe/4 :clock4:help wantedp/iOS 🍎t/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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

Contributor guide