How can I scale a scrollview item so it keeps its ratio?
Ive got a scrollview in which I display cards. These cards should keep their aspect ratio since the picture on them would end up looking bad.
The issue is when I change the aspect of the canvas, the cards stay the same scale, while the scrollview doesnt. Only the top of the card is now visible, since I added a layout group to the content of the scrollview which aligns the child component upper left.
When I check control child size -> height, the image fits in the scrollview, but starts to stretch the width. It should keep the same aspect ratio.
What I want is that the card in the scrollview (which is an image in a panel) to keep its aspect ratio, while adjusting its height to the scrollview. The width should make sure the aspect ratio stays the same. How can I do this?
Your answer
Follow this Question
Related Questions
How to maintain width at lower aspect ratios? 1 Answer
Designed UI for 2:1 aspect raito, how do I also make it fit 16:9? 1 Answer
Changing UI Image's sprite, preserve aspect ratio is checked but not working? 0 Answers
Reset (or change Pivot of) an Image in ScrollRect when scaling down 1 Answer
Unity 2018 Custom Aspect Ratio Not Being Enforced When For Test Build 0 Answers