In Autolayout:
- Establish a minimum distance between view1 and top border of superview.
- Establish fixed (minimum) distance between view1 and bottom border of superview.
- Leave out these minimum distances for view2.
Question
I have one parentview as Scrollview.I have added two subviews view1,view2 on that scrollview. But I need to do the following in same time
when I increase the height of one of my subviews view1 in runtime,parentview height should be changed using either Autolayout or Autoresizing
when I increase the height of one of my subviews view2 in runtime,parentview height should not be changed either Autolayout or Autoresizing
When I change the height of parent view in time, it should not affect its subviews.
Any help please?
Solution
In Autolayout:
OTHER TIPS
There is no need to use -layoutSubviews. When increasing subview view1's height, you can update scroll view's content size. When increasing subview view2's height or scroll view's height, does nothing else.