ItemsControl - Can't remove gaps #17651
Replies: 7 comments 7 replies
-
Any screenshot/XAML for context? |
Beta Was this translation helpful? Give feedback.
-
You need to style the ItemContainer to remove the default padding |
Beta Was this translation helpful? Give feedback.
-
Here is example code which might illustrate the issue. Really basic. With this code, you can see the very thin bleed from background between the items. I am so puzzled as to what is causing it, so hopefully obvious to someone else.
|
Beta Was this translation helpful? Give feedback.
-
Turns out this is not specific to itemscontrol, it’s all controls. Anytime within a view box, appears somehow creates the gaps. When view box removed, looks right…tried messing with view box settings but nothing seemed to work…I must be missing something obvious otherwise I suspect others would have seen this. I’ll keep looking:) |
Beta Was this translation helpful? Give feedback.
-
Thank you, I will give that a try and see if something that will work for me. Appreciate all the help! |
Beta Was this translation helpful? Give feedback.
-
I could not find those render options on Avalonia controls, unless just missing them. |
Beta Was this translation helpful? Give feedback.
-
Thank you for clarifying, haven’t had a chance to try the different background colors but I applied those values to my viewbox and it cleaned up bleeding between some of my controls so promising |
Beta Was this translation helpful? Give feedback.
-
Hello, hoping someone might be able to help. I have a pretty standard ItemsControl where I show a list of items. Each item has three label controls within a horizontal stackpanel. It functionally works great but a gap is left all around each label control, allowing the parent container's background color to slightly bleed through. I have ensured the labels and stackpanel have no margin or padding but still the parent's background color shows. Just can't get the labels to take the full space. I can't trick the background color of the parent to be the same as each label or stackpanel color because each row/label might have a different background color. Searched all over the place and the common answer was to remove margin/padding, which has no effect. I also tried using a -1 margin, which actually removed the gaps correctly but the text within the label was then cut off and became off centered. If I could have the text autosize within the -1 margin and not move it from center and not have text cut off, this would be acceptable solution too.
Thoughts? Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions