Created
July 10, 2020 14:58
-
-
Save jfversluis/b4768a10d43b374713b26351cfe5c634 to your computer and use it in GitHub Desktop.
Disable bounce effect on Xamarin.Forms CollectionView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using CollectionViewBounceSample.iOS; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Platform.iOS; | |
[assembly: ExportRenderer(typeof(CollectionView), typeof(NoBounceRenderer))] | |
namespace CollectionViewBounceSample.iOS | |
{ | |
public class NoBounceRenderer : CollectionViewRenderer | |
{ | |
public NoBounceRenderer() | |
{ | |
} | |
protected override void OnElementChanged(ElementChangedEventArgs<GroupableItemsView> e) | |
{ | |
base.OnElementChanged(e); | |
if (e.NewElement != null) | |
Controller.CollectionView.Bounces = false; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment