Bug 60097 - Labels not rendering in Carousel
Summary: Labels not rendering in Carousel
Status: NEEDINFO
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.4.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-10-10 17:10 UTC by Philipp Sumi
Modified: 2017-11-10 00:12 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

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 for Bug 60097 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEEDINFO

Description Philipp Sumi 2017-10-10 17:10:50 UTC
This is as fuzzy as it gets: With the latest XF version, I have some labels that probably aren't visible when being rendered initially, and thus aren't visible. I've had Label issues with XF before, but this is the worst I've seen so far - see the issue here:

https://www.dropbox.com/s/8xbmz2fecl1of4y/carousel-issue.mp4?dl=0

What's happening here:

* I open a view that contains three tabs (which basically are carousel pages), but immediately go to the second page.
* My guess is that the first page is already rendered, but not visible.
* When I swipe to the first tab, my labels aren't visible (or have a size of 0). The rest is fine.
* When I swipe to the last tab and back, the labels are visible, probably because the view is re-rendered.

I initially suspected the carousel since it struggles a bit with XF's quirky layout events, but turns out this happens with XF 2.4.0 only. Doesn't matter what version of the Alex Rainman's carousel I use. Downgrading to 2.3.4 solves the issue.

As I said, it's super fuzzy. But hope springs eternal - maybe i triggers a déja-vu :)
Comment 1 Paul DiPietro [MSFT] 2017-10-13 14:43:03 UTC
Philipp, since it looks like this is an Android issue per the video (unless the issue occurs on iOS as well), are you using the FastRenderer for Label, or the regular one? Can you also can only reproduce this when using that CarouselView? A reproduction would certainly be helpful just to speed up getting this looked into. Any more info is appreciated so we can get a better hold on the scenario. I'm changing the status for upkeep, but will be keeping an eye on this for anything you can provide.
Comment 2 Philipp Sumi 2017-10-16 07:51:04 UTC
Hi Paul

I didn't activate FastRenderers (they are disabled by default, right?). I'll check on iOS today to see whether it's Android only and will post back.
Comment 3 Philipp Sumi 2017-10-19 09:28:13 UTC
Ok, I found the bug (or one means to trigger it). I did some testing today, and a common thing for all the labels was the common style here.

            <Style x:Key="RowStyle"
                   TargetType="Label">
                <Setter Property="FontSize"
                        Value="{StaticResource StandardTextFontSize}" />
                <Setter Property="VerticalTextAlignment"
                        Value="Center" />
                <Setter Property="VerticalOptions"
                        Value="Center" />
                <Setter Property="HorizontalTextAlignment"
                        Value="Start" />
                <Setter Property="HorizontalOptions"
                        Value="Start" />
                <Setter Property="LineBreakMode"
                        Value="TailTruncation" />
            </Style>


Note that I did set xxxTextAlignment and xxxOptions both because I ran into rendering glitches on resuming the UIs without them. However, It turns out that the HorizontalOptions value caused the buggy rendering. If I remove it, the label renders ok.

This is not the first ticket I opened about weird Label rendering when reloading/layouting a page. Something is botched with them.
Comment 4 Philipp Sumi 2017-11-10 00:12:28 UTC
Btw, I sent the sources to David in order to give you a fighting chance of debugging some show-stopper rendering glitches I had after upgrading to XF latest. If you want to repro this, get the source from David, and just reinstate the commented out code in RideCard.xaml:

            <Style x:Key="RowStyle"
                   TargetType="Label">
                <Setter Property="FontSize"
                        Value="{StaticResource StandardTextFontSize}" />
                <Setter Property="VerticalTextAlignment"
                        Value="Center" />
                <Setter Property="VerticalOptions"
                        Value="Center" />
                <Setter Property="HorizontalTextAlignment"
                        Value="Start" />
                <!-- causes rendering issues: https://bugzilla.xamarin.com/show_bug.cgi?id=60097 -->
                <!--<Setter Property="HorizontalOptions"
                        Value="Start" />-->
                <Setter Property="LineBreakMode"
                        Value="TailTruncation" />
            </Style>