C# 将标题放入Xamrin表单中的导航返回栏

C# 将标题放入Xamrin表单中的导航返回栏,c#,xamarin,C#,Xamarin,嗨,我似乎有问题,让我的标题出现在导航区的后栏部分 这是我在xaml中的代码: <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Project.Settings"> <NavigationPage.TitleView>

嗨,我似乎有问题,让我的标题出现在导航区的后栏部分

这是我在xaml中的代码:

<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Project.Settings">
 <NavigationPage.TitleView>
     <Label Text="Settings" HorizontalTextAlignment="Center"/>
 </NavigationPage.TitleView>
<ContentPage.Content>
   
</ContentPage.Content>
我的代码就是这样做的:

我想这样做:

你能用完整的Xaml代码更新你的问题吗?我用你的代码检查了相同的代码。这对我来说很有效。请检查屏幕截图。你能提供更多的细节吗?@HimanshuDwivedi我刚刚更新了它的navingation.Pushasync(新导航页面(newyourpagename());尝试将页面作为导航页面打开。您的代码中的其他所有内容似乎都很好。它与我测试的代码相同。我在iphone12 14.4上进行了测试。请创建一个新项目以再次检查。
using System;
using System.Collections.Generic;

using Xamarin.Forms;

namespace Project
{
    public partial class Settings : ContentPage
    {
        public Settings()
        {
            InitializeComponent();
            NavigationPage.SetHasBackButton(this, true);
            NavigationPage.SetHasNavigationBar(this, true);
            NavigationPage.GetTitleView(this);
        }
    }
}