-
I tried to show some pictures in the ItemsRepeater and here's my code:
I have two pictures, a square and a rectangle, and they don't show up correctly at the same time When I set the image to Stretch="UniformToFill", both images are stretched and cannot be displayed in their entirety. When I set the image to Stretch="Fill", the square ones will display normally, and the rectangular ones will be squeezed. When I set the image to Stretch="Uniform", the rectangular ones will display normally, while the square ones will be squeezed. How can we make pictures of different shapes scale normally in the container without being stretched or squeezed? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 14 replies
-
On a side note: ItemsRepeater is being deprecated soonish. https://github.com/AvaloniaUI/Avalonia.Controls.ItemsRepeater |
Beta Was this translation helpful? Give feedback.
-
@timunie Why doesn't the ‘Uniform ’ keep the correct width and height ratio in my example? |
Beta Was this translation helpful? Give feedback.
I'm very sorry, I finally found the reason. It's because I specified the resolution when generating my image, which caused this problem. Thank you.