ViewPagerForms 1.0.4
ViewPagerForms
Install-Package ViewPagerForms -Version 1.0.4
dotnet add package ViewPagerForms --version 1.0.4
<PackageReference Include="ViewPagerForms" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ViewPagerForms --version 1.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Description
- A stable crossplatform ViewPager for iOS/Android
- There is no memory leak
- Easy to use.
Setup
- Available on NuGet: https://www.nuget.org/packages/ViewPagerForms [![NuGet]
- Install in your PCL project and Client projects.
iOS
- Add statement below to AppDelegate
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
ViewPagerRenderer.Init(true);
...
}
Android
- Add statement below to MainActivity
protected override void OnCreate(Bundle bundle)
{
...
global::Xamarin.Forms.Forms.Init(this, bundle);
ViewPagerRenderer.Init(true);
...
}
XAML:
First add the xmlns namespace:
xmlns:cv="clr-namespace:ViewPagerForms.Forms;assembly=ViewPagerForms.Forms"
Then add the xaml:
<cv:ViewPagerControl x:Name="viewpager" VerticalOptions="FillAndExpand" Position="{Binding Position, Mode=TwoWay}" ItemsSource="{Binding ListItems}" Infinite="false">
<cv:ViewPagerControl.ItemTemplate>
<DataTemplate>
<StackLayout BackgroundColor="Olive" Padding="10">
<StackLayout BackgroundColor="Red" VerticalOptions="FillAndExpand">
<Label Text="{Binding .}" FontSize="30" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" TextColor="Yellow"/>
</StackLayout>
</StackLayout>
</DataTemplate>
</cv:ViewPagerControl.ItemTemplate>
</cv:ViewPagerControl>
Code Behind:
public class ViewModel
{
public ObservableCollection<int> ListItems { get; set; }
public int Position { get; set; }
public ViewModel()
{
ListItems = new ObservableCollection<int>() { 1, 2, 3, 4, 5, 6, 9 };
Position = 5;
}
}
(https://www.youtube.com/watch?v=Liftcv-N_zo)
Description
- A stable crossplatform ViewPager for iOS/Android
- There is no memory leak
- Easy to use.
Setup
- Available on NuGet: https://www.nuget.org/packages/ViewPagerForms [![NuGet]
- Install in your PCL project and Client projects.
iOS
- Add statement below to AppDelegate
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
ViewPagerRenderer.Init(true);
...
}
Android
- Add statement below to MainActivity
protected override void OnCreate(Bundle bundle)
{
...
global::Xamarin.Forms.Forms.Init(this, bundle);
ViewPagerRenderer.Init(true);
...
}
XAML:
First add the xmlns namespace:
xmlns:cv="clr-namespace:ViewPagerForms.Forms;assembly=ViewPagerForms.Forms"
Then add the xaml:
<cv:ViewPagerControl x:Name="viewpager" VerticalOptions="FillAndExpand" Position="{Binding Position, Mode=TwoWay}" ItemsSource="{Binding ListItems}" Infinite="false">
<cv:ViewPagerControl.ItemTemplate>
<DataTemplate>
<StackLayout BackgroundColor="Olive" Padding="10">
<StackLayout BackgroundColor="Red" VerticalOptions="FillAndExpand">
<Label Text="{Binding .}" FontSize="30" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" TextColor="Yellow"/>
</StackLayout>
</StackLayout>
</DataTemplate>
</cv:ViewPagerControl.ItemTemplate>
</cv:ViewPagerControl>
Code Behind:
public class ViewModel
{
public ObservableCollection<int> ListItems { get; set; }
public int Position { get; set; }
public ViewModel()
{
ListItems = new ObservableCollection<int>() { 1, 2, 3, 4, 5, 6, 9 };
Position = 5;
}
}
(https://www.youtube.com/watch?v=Liftcv-N_zo)
Release Notes
- [Android/iOS]Handle Remove Item
- [Android/iOS]Add option for Log
Dependencies
-
MonoAndroid 7.1
- Xamarin.Android.Support.Animated.Vector.Drawable (>= 25.3.1)
- Xamarin.Android.Support.Annotations (>= 25.3.1)
- Xamarin.Android.Support.Compat (>= 25.3.1)
- Xamarin.Android.Support.Core.UI (>= 25.3.1)
- Xamarin.Android.Support.Core.Utils (>= 25.3.1)
- Xamarin.Android.Support.Design (>= 25.3.1)
- Xamarin.Android.Support.Fragment (>= 25.3.1)
- Xamarin.Android.Support.Media.Compat (>= 25.3.1)
- Xamarin.Android.Support.Transition (>= 25.3.1)
- Xamarin.Android.Support.v4 (>= 25.3.1)
- Xamarin.Android.Support.v7.AppCompat (>= 25.3.1)
- Xamarin.Android.Support.v7.CardView (>= 25.3.1)
- Xamarin.Android.Support.v7.MediaRouter (>= 25.3.1)
- Xamarin.Android.Support.v7.Palette (>= 25.3.1)
- Xamarin.Android.Support.v7.RecyclerView (>= 25.3.1)
- Xamarin.Android.Support.Vector.Drawable (>= 25.3.1)
- Xamarin.Build.Download (>= 0.4.3)
- Xamarin.Forms (>= 2.3.4.247)
-
Portable Class Library (.NETFramework 4.5, Windows 8.0, WindowsPhoneApp 8.1)
- Xamarin.Forms (>= 2.3.4.247)
-
Xamarin.iOS 1.0
- Xamarin.Forms (>= 2.3.4.247)
Used By
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.