0

How to use both vertical and horizontal ScrollView in Xamarin iOS ?

I am using CollectionView but with it I only get one scrollview working at a time.

Louis 'LYRO' Dupont
  • 810
  • 1
  • 13
  • 30
  • [This post on Xamarin forums](https://forums.xamarin.com/discussion/20834/horizontal-scrollview-within-vertical-scrollview) seems to be wath you want. – Louis 'LYRO' Dupont May 28 '19 at 12:34
  • Yes but I want to working vertical and horizontal scrollview IN Xamarin ios @Louis'LYRO'Dupont – kevin patel May 29 '19 at 05:20
  • You want a scrollView that can scroll in both vertical and horizontal ? Or a CollectionView that can scroll in both vertical and horizontal ?? – Jack Hua May 29 '19 at 05:36
  • Collectionview that can scroll in both vertical and horizontal in xamarin iOS @JackHua-MSFT – kevin patel May 29 '19 at 07:31
  • Check the answer in [this](https://stackoverflow.com/questions/13179703/uicollectionview-scrolling-in-both-directions) thread may help. – Jack Hua May 30 '19 at 05:32
  • Thanks but Not working can help for Xamarin iOS solution @JackHua-MSFT – kevin patel May 30 '19 at 06:24

1 Answers1

0

It's because it's nature of collection view, you can make it scroll in one direction at a time i.e. either horizontal or vertical. What you exactly want to achieve that you have not mentioned. if you are going to use collection view inside the scroll view, you have to manage it properly.

The best solution would be use a UICollectionView for the horizontal scroll and the UITableView for the vertical scroll.

But if you want to make it work only using UICollectionView you have to use Subclassing UICollectionViewLayout.

here is link you can refer to make it work, hope this might help you:

1.https://www.brightec.co.uk/ideas/uicollectionview-using-horizontal-and-vertical-scrolling-sticky-rows-and-columns

2.Subclassing UICollectionView

3.UICollectionView scrolling in both directions

Divyesh_08
  • 787
  • 6
  • 16