question

BrendenJacobson-8295 avatar image
0 Votes"
BrendenJacobson-8295 asked LeonLu-MSFT commented

.Net Maui spacing within collection view

I am having some trouble formatting items in a collection view.

  • How do I set the spacing between elements in a collection view (see the attached file for the XAML) ? I always seem to end up with double spacing.

  • Also how do I get the new items to appear at the bottom of the view? ItemsUpdatingScrollMode="KeepLastItemInView" does not seem to work. As a work around I have tried adding new items to the front of the list. This sort of works, but looks a bit wierd (It does not work on Android by the way)


Thanks

.

227537-collectionview.txt227430-messages.png




dotnet-maui
messages.png (8.2 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

How do I set the spacing between elements in a collection view (see the attached file for the XAML) ? I always seem to end up with double spacing.

I tested it in MAUI 6.0.486, I cannot reproduce this issue. Please share MAUI version. Could you minimize code to just what is needed to reproduce the problem?

Also how do I get the new items to appear at the bottom of the view?

When you need to add items to CollectionView, do you want to scroll to the end of last item?

As note: how to write a quality answer


0 Votes 0 ·

I need to manually scroll to see the last item

You can create a custom CollectionView, then use handler to call native platform API to scroll the last item. Please refer to this thread.


0 Votes 0 ·

Thanks

0 Votes 0 ·
LeonLu-MSFT avatar image LeonLu-MSFT BrendenJacobson-8295 ·

You are welcome.

0 Votes 0 ·

0 Answers