xamarin/Xamarin.Forms

[Bug] Empty iOS ViewCell label does not update

Aperta

#6118 aperta il 7 mag 2019

 (2 commenti) (0 reazioni) (0 assegnatari)C# (1926 fork)batch import
a/listviewe/4 :clock4:help wantedp/iOS 🍎t/bug :bug:up-for-grabs

Metriche repository

Star
 (5644 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor