locked
Printerest like CollectionView renderer for iOS in Xamarin.Forms? RRS feed

  • Question

  • User395076 posted

    After some research I could find the custom renderer for CollectionView in Android and it works great, but I couldn't find the equalant for iOS. Please help me create it for iOS. Thanks

    Custom CollectionView for android:

    [assembly: ExportRenderer(typeof(CollectionView), typeof(CustomCollectionViewRenderer))]
    namespace App.Droid
    {
        public class CustomCollectionViewRenderer : CollectionViewRenderer
        {
            public CustomCollectionViewRenderer(Context context) : base(context)
            {
            }
    
            protected override void OnElementChanged(ElementChangedEventArgs<ItemsView> elementChangedEvent)
            {
                base.OnElementChanged(elementChangedEvent);
    
                if (elementChangedEvent.NewElement != null)
                {
                    StaggeredGridLayoutManager manager = new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.Vertical);
                    SetLayoutManager(manager);
                }
            }
        }
    }
    

    Custom CollectionView for iOS: ??

    Friday, July 3, 2020 4:52 PM

All replies

  • User369978 posted

    Do you want Waterfall effect ?

    Unfortunately , We can't do this on iOS ..

    Monday, July 6, 2020 9:43 AM
  • User395076 posted

    @ColeX Yes

    This is the output I got from android custom renderer.

    Why iOS why? :'(

    Monday, July 6, 2020 9:46 AM
  • User369978 posted

    Try to customize the layout the collecitonview in custom renderer ,refer to here .

    But per my experience , we can't be able to implement waterfall flow with CollectionView on iOS .

    Tuesday, July 7, 2020 2:12 AM