I want to place the button lower relative the end of the text. How do I do this? now so
Asked
Active
Viewed 134 times
0
-
What did you try? Are you using auto-layout? What are your constraints? What research have you done? – Wain Jan 08 '14 at 10:42
-
Does that text in label? Are you setting text dynamically? – Dilip Manek Jan 08 '14 at 10:51
-
Yes. now I measure the height of the text and respect thereto exhibit button. But I think it all has to be done much easier – R00We Jan 08 '14 at 10:54
2 Answers
0
You can't place it relative to the text. However, it looks like the text is in a UILabel which will expand depending on how much text there is.
All you have to do is place the button relative to the bottom of the label and it will be placed below the text.

Fogmeister
- 76,236
- 42
- 207
- 306
0
Give the Height + Y
of your label as Y value
in your button and it will display below your label.
yourLabel = your current text label....
yourButton.frame = CGRectMake(yourXValue, yourLabel.frame.origin.y + yourLabel.frame.size.height ,yourwidthValue, yourHeightValue);
Or use this code.. whichever you like
CGRect frame =yourButton.frame;
frame.origin.y = yourLabel.frame.origin.y + yourLabel.frame.size.height;
yourButton.frame = frame;

Dilip Manek
- 9,095
- 5
- 44
- 56