Hierarchy of a ViewController
ScrollView
|_ _ UIView (Height and width equal to its superView)
|_ _ UIView (Set Height to 150 and I put a label inside this view and set number of lines to 0)
|_ _ UIView (Align bottom to top view with the height of 150)
If I keep the label.text
too much then it's going behind the bottom view like this:
How can I keep the constant vertical distance between the second view and first view? So that it won't distort the UI. I want to achieve this
The approach I am using won't work because I am providing the fixed height for both UIView
. Is there any way that we can handle the dynamic length of label
in a UIScrollView
?
ScrollView
|_ _ UIView (Height and width equal to its superView)
|_ _ UIView (Set Height to greater than or equal 150 and I put a label inside this view and set number of lines to 0)
|_ _ UIView (Align bottom to top view with the height of 150)
the view reduces to a standard value of 150 according to the text of the label