Forum Xamarin.Forms

How to use vertical CollectionView inside ScrollView? Items are being added on the bottom

idchlifeidchlife Member ✭✭

It seems everyone over the internet saying that CollectionView should not be used inside ScrollView.

I am having rather interesting layout,

You see at the bottom of it a list of items. They should expand parent which wraps of the entire page.

Basically, it's not a small scrolling area at the bottom, but this list could have 10+ items.

The problem as I suspect is with using CollectionView inside ScrollView. My CollectionView is the last Grid.Row with Width="*" (which I presume means get all the space you need).

If there are 1-3 items in CollectionView, there somehow appears a ton of space at the bottom. Some kind of huge Margin bottom or something.

If there are 10+ items, it is visible that CollectionView actually somehow takes some area of fixed Height and uses it instead of forcing parent views to adjust to the height of this CollectionView items. It has a scrollbar if there are 10+ items. So first user will scroll page down, then scroll more to view more of a CollectionView, and then scrolling stops and after user tries to scroll down - this fixed Height CollectionView scrolls.

I can't seem to understand, if one not to use ListView/CollectionView in ScrollView with not a simple design, how to add dynamically items at the bottom to give user a feeling of a long page with items?

Is there some kind of @foreach Razor equivalent for I'm missing?

Best Answer


Sign In or Register to comment.