Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Created attachment 24195 [details]
Text appearance before navigating away
Xamarin Forms version: 126.96.36.199
Visual Studio 2017 Professional
Xamarin version: 188.8.131.526
Android device version: 7.0
I am only seeing this happen on Android. I do not see this behaviour on iOS at all.
The label is defined as:
<Label x:Name="connectedDevice" FontAttributes="Bold" FontSize="Large" HorizontalTextAlignment="Center" Grid.Row="0"></Label>
I currently do not have an override on `OnAppearing`. This happens after a single navigation away and then back to the page.
When the app loads the first page displayed is the page in the screenshot. Bluetooth devices are scanned, the user selects a device, and the label above is changed with 'connectedDevice.Text = " Connected to: " + bd.DisplayName + "\n Battery: " + App.BatteryLevel + "%";`. Any amount of altering the text in the Label while still on the page will not cause the text to become left-justified. It is only after navigating to say the 'Train' page then back to 'Settings'
It looks as though the text stays centered relative to itself, in that the 2nd line of the text is centered relative to the first line, however it becomes left-justified.
Have you tested this against the latest prerelease or nightly build to see if the issue has been resolved already? Does it only occur when you're using a TabbedPage, or on certain devices/Android versions? Can you upload a reproduction project as well that we can refer to?
It appears setting 'HorizontalOptions="CenterAndExpand"' on the Label has fixed the issue, however it may be worth noting that this is not necessary on iOS.
I will update again if I see the issue come back.
As it has been over 30 days without an update, we will assume this is no longer an issue for you. If there is a clear and reproducible bug (with a provided reproduction project), please submit one and reopen as necessary.