Xamarin.forms: [iOS] TitleView on iOS is always center align

Created on 29 Aug 2018  路  7Comments  路  Source: xamarin/Xamarin.Forms

Description

While investigating issue #3644 I found that the rendering is not consistent what user would expect. I m not able to align the TitleViewcontent to the left on the iOS platform.

Steps to Reproduce

Run this code as set tabbedPage as `MainPage.

var tabbedPage = new TabbedPage();

var grid = new Grid
{
        BackgroundColor = Color.Gray,
        HorizontalOptions = LayoutOptions.Fill,
        VerticalOptions = LayoutOptions.FillAndExpand
};
grid.RowDefinitions.Add(new RowDefinition());
grid.RowDefinitions.Add(new RowDefinition());

var label = new Label { Text = "hello", HorizontalOptions = LayoutOptions.Start, BackgroundColor = Color.Yellow };
var label2 = new Label { Text = "hello 2", HorizontalOptions = LayoutOptions.Start, BackgroundColor = Color.Yellow };
grid.Children.Add(label);
grid.Children.Add(label2);
Grid.SetRow(label2, 1);
var header = new ContentView
{
    BackgroundColor = Color.Pink,
    HorizontalOptions = LayoutOptions.Fill,
    Content = grid
};
var page = new ContentPage
{
    Content = new Entry { Text = "Normal entry" }
};

var navigationPage = new NavigationPage(page);
NavigationPage.SetTitleView(page, header);

tabbedPage.Children.Add(navigationPage);

Expected Behavior

Should be able to align the labels to the left

Actual Behavior

Labels and grid status aligned to on center

Basic Information

  • Version with issue: master 11bbc6abc95a239ffd5d6b7556c2b3697264750c

Screenshots

simulator screen shot - iphone 5s - 2018-08-29 at 19 23 01
screenshot_1535566912

blocker 4 iOS 馃崕 bug

All 7 comments

As well as FillAndExpand is not working for TitleView in case of iOS.

And please addressed this issue in upcoming 3.2 build.

@PWaliaDev

The fix for this has been pushed to the latest 3.3.0 SR release.
Please let us know if that resolves your issue

@PureWeen is this fix coming in v3.4 ? I installed v3.4 pre3 and I still see the issue.

Thanks

BTW - this issue exists on both iOS and Android platform. I haven't validated it on UWP.

@IoTFier this should be fixed. Can you create a new issue with a repro please so that we can see what issue you are having?

I know you created this issue
https://github.com/xamarin/Xamarin.Forms/issues/3644

But what this issue fixed is different than what you are referring to in #3644

@PureWeen, I don't think either this issue has been fixed or mine #3644 .

Here is the screenshot of my page that I am using to assess Syncfusion controls before finalizing usage in my App. Look at the TitleView on both iOS and Android.
In iOS it is centered all the time .. How does it matter if the code is authored from code behind or XAML if the outcome is still broken ? I consider this ticket as the sub issue to #3644.

Please also note the height of the Titleview on iOS gets chopped. It should render the view as defined in the supplied ContentView. Otherwise it is a bad UX.

image

Here is another screenshot (both are discussed on the gitter Xamarin.Form channel) that shows height being chopped on iOS

image

Android also Height is getting chopped.

Was this page helpful?
0 / 5 - 0 ratings