rid
rid

Reputation: 63442

Expand view in iOS

Views in iOS have the option to "Clip Subviews" which hides everything that overflows the view height. Is there any option for the opposite? I mean, instead of hiding the content, I'd like the view to expand vertically to accomodate the content.

Upvotes: 0

Views: 557

Answers (1)

Jacob Relkin
Jacob Relkin

Reputation: 163228

Use the autoresizingMask property on UIView to get the desired behavior:

view.autoresizingMask = UIViewAutoresizingFlexibleHeight;

If this doesn't do what you want, the only other option you have (AFAIK) is to subclass UIView and override -layoutSubviews.

Upvotes: 1

Related Questions