Я думаю, может быть, привязка не работает. Я делаю образец для вашей справки.
MainPage.xaml
<StackLayout>
<Button Clicked="Button_Clicked" Text="Title View Page" />
</StackLayout>
MainPage.xaml.cs
private void Button_Clicked(object sender, EventArgs e)
{
Navigation.PushAsync(new TitleViewPage());
}
TitleViewPage.xaml
<ContentPage.Resources>
<ResourceDictionary>
<Style x:Key="TittleLabel" TargetType="Label">
<Setter Property="TextColor" Value="Green" />
<Setter Property="FontSize" Value="Large" />
</Style>
</ResourceDictionary>
</ContentPage.Resources>
<NavigationPage.TitleView>
<StackLayout>
<Label
HorizontalOptions="Start"
HorizontalTextAlignment="Start"
Style="{StaticResource TittleLabel}"
Text="{Binding Title}"
VerticalOptions="CenterAndExpand" />
</StackLayout>
</NavigationPage.TitleView>
<ContentPage.Content>
<StackLayout>
<Label
HorizontalOptions="CenterAndExpand"
Text="Welcome to TitleView Page!"
VerticalOptions="CenterAndExpand" />
</StackLayout>
</ContentPage.Content>
TitleViewPage.xaml.cs
publi c string Title {get; набор; } publi c TitleViewPage () {InitializeComponent (); Title = "My TitleView"; this.BindingContext = this; }
App.xaml.cs
public App()
{
InitializeComponent();
MainPage = new NavigationPage(new MainPage());
}
Обновлено:
При установке FlowDirection
на RightToLeft
вид заголовка можно увидеть на горизонтальном экране.
В локализации справа налево документ, в нем перечислены ограничения. https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/localization/right-to-left
Расположение кнопки NavigationPage, расположение элемента панели инструментов и анимация перехода управляются языком устройства, а не свойством FlowDirection.
Этот вопрос также сообщается. Вы можете следить за обновлением. https://github.com/xamarin/Xamarin.Forms/issues/9083