-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Margin and Padding don't work in CollectionView #23211
Comments
Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you! Open similar issues:
Closed similar issues:
|
This issue has been verified using Visual Studio 17.11.0 Preview 2.1 (8.0.40 & 8.0.60 & 8.0.14). Can be reproduced on iOS platform. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@samhouts Hi. Any news about this? |
Just to document my experience because this isn't limited to iOS. I have the same issue on Windows. I have a Border view directly in a collection view DataTemplate and the Margin values have no affect at all on Windows. I'm trying to add a Border to each item in the CollectionView and add spacing in between them. For example, the Margins on the Border in this example are completely ignored (although the Padding does work):
If I simply wrap the Border in a Grid (or any other type of container View) without changing anything else then the margins on the border suddenly work. For example:
It's worth noting that the obsolete Frame View also behaves this same way. Margins on Grids, Stacklayouts, etc work as expected. |
Hey, Currently I am doing it too and it works as expected for MAUI. Using the padding or margin directly on root view in item template had always some problems depending on used platform. |
there are some news about this issue? Will be moved on a sprint? |
Hi. Are there some news about this? |
Well if you are so fast on closing issues about key problems, i would also like to know the current state about this, because its blocking us to deploy on other platforms than Android! @samhouts Please? |
i have encountered similar issue only on iOS when using collection view with observable collection and two way bindings. My workaround is to use a grid and add a second row for example of 20 heigh and leave it blank in purpose:
|
Hey @IliyanPopov, I believe that wrapping into ContentView should be performance more efficient than Grid.
|
Description
On iOS Margin and Padding don't work in CollectionView. In the attached example, I have 3 collection views.
In the first, a grid with padding appears to maintain padding correctly.
In the second, the grid with the margin does not maintain the margin: I would expect there to be white space around the grid but the blue color is continuous.
In the third (with border), it seems that the padding is replaced by a margin.
I have seen that in the past some bugs relating to these problems have already been opened, apparently resolved, but apparently not correctly
Steps to Reproduce
Run the project
presso "popup problem!!!!" button
a page with 3 collections should appears
Link to public reproduction project repository
https://github.com/acaliaro/MauiCollectionViewPaddingProblems
Version with bug
8.0.60 SR6
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI, Yes, this used to work in Xamarin.Forms
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 17.3 iphone 12
Did you find any workaround?
I think this could help #17885 (comment)
Relevant log output
No response
The text was updated successfully, but these errors were encountered: