Bug 60436 - Label height not refreshed (only when: delayed text update, Android 4.0.3, NavigationPage, ScrollView, StackLayout)
Summary: Label height not refreshed (only when: delayed text update, Android 4.0.3, Na...
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.5.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-10-30 15:17 UTC by Milan Laslop
Modified: 2018-02-12 18:25 UTC (History)
6 users (show)

Tags: label, height, pre-appcompat, ac
Is this bug a regression?: ---
Last known good build:


Attachments
test project (53.06 KB, application/x-zip-compressed)
2017-10-30 15:17 UTC, Milan Laslop
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Milan Laslop 2017-10-30 15:17:07 UTC
Created attachment 25504 [details]
test project

STEPS TO REPRODUCE
- see attachments - xamarin_forms_label_test.zip
- run the app on Android 4.0.3 or 4.1.2 (the 4.1.2 emulator from Android SDK works for sure)
- click Go To Next Page
- two lines of text appear (line1, line2)
- background task waits 7 seconds, then updates Label - adds line3
- problem: line3 is not shown (height of Label is not recalculated)

Can be reproduced with Xamarin Forms 2.4.0.18342 and Xamarin Forms 2.5.0.19271-pre2

Exactly these conditions must be met for it to be reproducible:
- must be Android 4.0.3 or 4.1.2, maybe some newer, but not e.g. 7.1.1 (on 7.1.1, it works correctly)
- Label must be in ScrollView and then StackLayout - leaving out ScrollView or StackLayout causes correct behavior
- we must update the Label text later, not directly in Page2 constructor (as you can see, constructor adds 2 lines (line1 and line2) and the height is calculated correctly here)
- Page2 has to be pushed to stack of a NavigationPage - it works correctly if Page2 is directly passed to constructor of NavigationPage as the root page (that's why there is Page1 with the big button)
Comment 1 Paul DiPietro [MSFT] 2017-11-07 18:38:56 UTC
Occurred on a 4.2.2 emulator as well; will set to confirmed until further investigation can be made.
Comment 2 Luiz Arantes Sa 2017-12-06 16:56:58 UTC
I'm also experiencing this issue. Labels sometimes won't render at all and it's only happening in Android 4.1. I had to downgrade to Xamarin.Forms 2.3 to get things workings again.
Comment 3 Luiz Arantes Sa 2017-12-06 17:09:51 UTC
Tested on Android 4.1.2:
- Works in Xamarin.Forms.2.3.4.247
- Broken in Xamarin.Forms.2.4.0.91020
Comment 4 Lukáš Novotný 2017-12-08 15:30:42 UTC
This is very likely duplicate of https://bugzilla.xamarin.com/show_bug.cgi?id=60155
Comment 5 Samantha Houts [MSFT] 2018-02-12 18:25:53 UTC
This issue has been migrated to https://github.com/xamarin/Xamarin.Forms/issues/1332. Please follow that issue for updates. Thanks!