Reputation: 3573
I have a NSViewController
with an attached view defined in a xib
. Everything is done properly (at least I hope), so that when I change the height of the view, all the subviews stay properly organized.
I want to change the height of the view programmatically. Basically, one of the subviews of my view is an NSTextView
and when there is a lot of text inside, I want to enlarge the view.
If I change the frame.size
of the view, nothing happens, because of the auto layout I think.
Is there a standard way to change the height (or the width) of the view in such a context ?
EDIT :
I have added a constraint to the view : I "pined" its height
.
Then, I have added this constraint as an IBOutlet
property.
Thus, I can change the .constant
value of the constraint.
Upvotes: 1
Views: 1800
Reputation: 3573
IBOutlet
property..constant
value of it to change the size of your view.Upvotes: 3