Přetáhnutí stránky TabbedPage na Androidu

Ukázka stažení Stažení ukázky

Tato specifická platforma pro Android slouží k povolení Potažení prstem mezi stránkami v TabbedPage . Je spotřebované v jazyce XAML nastavením TabbedPage.IsSwipePagingEnabled připojené vlastnosti na boolean hodnotu:

<TabbedPage ...
            xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
            android:TabbedPage.OffscreenPageLimit="2"
            android:TabbedPage.IsSwipePagingEnabled="true">
    ...
</TabbedPage>

Alternativně se dá využít z C# pomocí rozhraní Fluent API:

using Xamarin.Forms.PlatformConfiguration;
using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
...

On<Android>().SetOffscreenPageLimit(2)
             .SetIsSwipePagingEnabled(true);

TabbedPage.On<Android>Metoda určuje, že tato specifická platforma bude spuštěna pouze v Androidu. Xamarin_Forms _PlatformConfiguration_AndroidSpecific_TabbedPage_SetIsSwipePagingEnabled_ Xamarin_Forms _BindableObject_System_Boolean_ "data-LINKTYPE =" absolutní cesta ">TabbedPage.SetIsSwipePagingEnabled metoda v Xamarin.Forms.PlatformConfiguration.AndroidSpecific oboru názvů slouží k povolení potažení mezi stránkami v TabbedPage . Kromě toho TabbedPage má třída v Xamarin.Forms.PlatformConfiguration.AndroidSpecific oboru názvů také Xamarin_Forms TabbedPage _PlatformConfiguration_AndroidSpecific_TabbedPage_EnableSwipePaging_ Xamarin_Forms _IPlatformElementConfiguration_ Xamarin_Forms _PlatformConfiguration_Android_ Xamarin_Forms _TabbedPage__ "data-LINKTYPE =" absolutní cesta ">EnableSwipePaging metoda, která umožňuje konkrétní platformu a Xamarin_Forms Xamarin.Forms.PlatformConfiguration.AndroidSpecific _PlatformConfiguration_AndroidSpecific_TabbedPage_DisableSwipePaging_ Xamarin_Forms _IPlatformElementConfiguration_ Xamarin_Forms _PlatformConfiguration_Android_ Xamarin_Forms _TabbedPage__ "data-LINKTYPE =" absolutní cesta ">DisableSwipePaging metoda, která zakazuje tuto specifickou platformu. TabbedPage.OffscreenPageLimitVlastnost Attached a Xamarin_Forms TabbedPage.OffscreenPageLimit _PlatformConfiguration_AndroidSpecific_TabbedPage_SetOffscreenPageLimit_ Xamarin_Forms _BindableObject_System_Int32_ "data-LINKTYPE =" absolutní cesta ">SetOffscreenPageLimit Metoda slouží k nastavení počtu stránek, které mají být uchovány v nečinném stavu na obou stranách aktuální stránky.

Výsledkem je, že potáhnutím stránkování přes stránky zobrazené v TabbedPage je povoleno:

Přetáhnutí stránkování přes TabbedPage