0

I want to place the button lower relative the end of the text. How do I do this? now so

enter image description here

Dilip Manek
  • 9,095
  • 5
  • 44
  • 56
R00We
  • 1,931
  • 18
  • 21

2 Answers2

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