タブ ナビゲーションを使用していてページを使用していて、新しいページを開きたいと考えています。
私の app.xaml.cs で、ナビゲーション ページを作成します。
public App()
{
InitializeComponent();
MainPage = new NavigationPage(new RootPage());
}
RootPage で、ナビゲーションを入力します。
public RootPage()
{
NavigationPage.SetHasNavigationBar(this, false);
Children.Add(new TestPage1
{
Title = "TestPage1"
});
Children.Add(new TestPage2
{
Title = "TestPage2"
});
Children.Add(new TestPage3
{
Title = "TestPage3"
});
}
このタイプのナビゲーションはすでにかなりうまく機能しており、見栄えも良いです。ここで、TestPage3: TestPage3.xaml 内で新しいページを開きたいと思います。
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="DemoApplication.TestPage3">
<Button x:Name="openSetup" Clicked="ItemClicked" Text="open Settings"/>
</ContentPage>
TestPage3.xaml.cs:
namespace DemoApplication
{
public partial class TestPage3 : ContentPage
{
public TestPage3()
{
InitializeComponent();
}
void ItemClicked(object sender, EventArgs e)
{
Navigation.PushAsync(new TestPage4());
}
}
}
これも機能しますが、見た目が良くありません。
新しいコンテンツは元のタブ ナビゲーションの下に読み込まれ、読み込まれた後はタブ ナビゲーションが消えます。
サウンドクラウドのような他のアプリでも同じことをしますが、よりスムーズに見えます.
タブナビゲーションをバックナビゲーションの間でよりスムーズにシフトする方法はありますか?
ご協力いただきありがとうございます :)