Bug 55359 - HorizontalTextAlignment="Center" looses alignment when TabbedPage background
Summary: HorizontalTextAlignment="Center" looses alignment when TabbedPage background
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.3.4
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-04-19 04:05 UTC by Yuka Abuno
Modified: 2017-10-24 07:45 UTC (History)
5 users (show)

Tags: android textalignment tabbedpage label ac
Is this bug a regression?: No
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 55359 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:
CONFIRMED

Description Yuka Abuno 2017-04-19 04:05:13 UTC
Label's HorizontalTextAlignment is not working when Label.Text on TabbedPage not displayed page is updated.

reproduce case : https://github.com/yuka1984/xfandroidHorizontalTextAlignmentBug

Screen : https://github.com/yuka1984/xfandroidHorizontalTextAlignmentBug/blob/master/ezgif-1-f259c9c5b3.gif
Comment 1 Jimmy [MSFT] 2017-04-20 16:01:23 UTC
I am able to reproduce this issue with the project linked to in the description. This appears to only be occurring on Android.

Updating the Label on another child page causes it to lose its HorizontalTextAlignment. However updating that same Label when the page is the current page restore the correct alignment.


### Version Tests
2.3.5-pre1  BAD
2.3.4.224   BAD
2.3.3.193   BAD
Comment 2 Yuka Abuno 2017-04-21 03:53:31 UTC
I made additional verification.

It was found that the phenomenon does not occur in the pattern specifying the fixed height using Grid.

    <StackLayout>
      <!-- OK -->
      <Grid>
        <Grid.RowDefinitions>
          <RowDefinition Height="30" />
          <RowDefinition Height="30" />
        </Grid.RowDefinitions>
        <Label Grid.Row="0" 
                            BackgroundColor="Silver" 
                            x:Name="GridExplicitHeight" 
                            TextColor="White" HorizontalTextAlignment="Center"/>
        <Label Grid.Row="1" 
                            BackgroundColor="Silver" 
                            x:Name="GridAutoHeight" 
                            TextColor="White" HorizontalTextAlignment="Center"/>
      </Grid>
      
      <!-- Bad -->
      <Grid>
        <Grid.RowDefinitions>
          <RowDefinition Height="30" />
          <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Label Grid.Row="0" 
                            BackgroundColor="Silver" 
                            x:Name="GridExplicitHeight2" 
                            TextColor="White" HorizontalTextAlignment="Center"/>
        <Label Grid.Row="1" 
                            BackgroundColor="Silver" 
                            x:Name="GridAutoHeight2" 
                            TextColor="White" HorizontalTextAlignment="Center"/>
      </Grid>
    </StackLayout>

ScreenShot
https://github.com/yuka1984/xfandroidHorizontalTextAlignmentBug/blob/master/screenshot_2017-04-21-12-15-44.png