I'm having a problem with scrollable content. Basically, I want to place one ImageView
and one Label
on the screen with ImageView
width equals screen
width. height
depends on intrinsic
content
aspect
ratio
(while width is always equal screen width).
The label
is 20 spacing bellow ImageView
. That means whole content height may less or equal or even longer than the root view
. What I have tried is to put Label
and ImageView
inside a StackView
(ImageView
has Aspectfit
setting), Then put StackView
inside ScrollView
. Set up constraints
as below.
The problem is the distance between ImageView and top Superview
and between ImageView
and Label
is too big (ideally should be 20). Is there any way to achieve the desired outcome?
PS: I have tried to set stackView distributtion but no help