Xamarin フォームを使用して TabbedPage を作成しています。問題は、タブ間をスワイプしたいのですが、これがデフォルトで無効になっていることです。SwipeEnable という 1 つの属性と、スワイプ イベントを呼び出すいくつかのメソッドを持つ ExtendedTabbedPage というクラスが 1 つ見つかりました。これは、ExtendedTabbedPage から拡張され、いくつかのコンテンツを含む 2 つのタブを作成する私のクラスです。swipeEnabled 属性の値を設定しましたが、何もしません。このクラスからスワイプイベントを呼び出す方法はありますか?
public class TabbedPageComplete: ExtendedTabbedPage
{
public TabbedPageComplete ()
{
this.Title = "TabbedPage";
this.SwipeEnabled = true;
this.Children.Add (new ContentPage
{
Title = "Blue",
Content = new BoxView
{
Color = Color.Blue,
HeightRequest = 100f,
VerticalOptions = LayoutOptions.Center
},
}
);
this.Children.Add (new ContentPage {
Title = "Blue and Red",
Content = new StackLayout {
Children = {
new BoxView { Color = Color.Blue },
new BoxView { Color = Color.Red}
}
}
});
}
}