I'm doing this all in code so I don't have to do the same thing twice.
I have two labels and a button.
I want one label to always be 20 points from the top
I want the button to always be 20 points from the bottom
I want the other label to always be 20 points down from the bottom of the label at the top and to be multilined with word wrap.
The problem is that I won't know how big the multilined label should be as the text will keep changing.
How do I use constraints to keep the title from resizing?
If I use the visual constraint:
then the descriptionLabel doesn't change height. The titleLabel does.
I can put in a value for the descriptionLabel's height but I don't know what that should be.
I know in the old days I could just call sizeToFit on descriptionLabel to make the right height to fit all the text but I don't know what you do for the constraints.
Anyone got any ideas?
I would also like to add that
gets me a large gap between descriptionLabel and startButton but descriptionLabel doesn't change height to fit the text.
will change the titleLabel's height. I don't know how to restrict it to not change size when I don't know what size it is.
I have two labels and a button.
I want one label to always be 20 points from the top
I want the button to always be 20 points from the bottom
I want the other label to always be 20 points down from the bottom of the label at the top and to be multilined with word wrap.
The problem is that I won't know how big the multilined label should be as the text will keep changing.
How do I use constraints to keep the title from resizing?
If I use the visual constraint:
Code:
:@"V:|-[titleLabel]-[descriptionLabel]-[startButton]-|"
I can put in a value for the descriptionLabel's height but I don't know what that should be.
I know in the old days I could just call sizeToFit on descriptionLabel to make the right height to fit all the text but I don't know what you do for the constraints.
Anyone got any ideas?
I would also like to add that
Code:
V:|-[titleLabel]-[descriptionLabel(>=20)]-(>=20)-[startButton]-|
Code:
V:|-[titleLabel]-[descriptionLabel(>=20)]-[startButton]-|
Last edited: