I'm new to iOS. I want to know how to remove space occupied by a button instead of hiding the button.
First I have 3 buttons. After clicking on button 2 I want to remove the space occupied by button 2 and change the position of button 3 position
How to remove space occupied by a button by button click
nr: #1 dodano: 2016-12-27 14:12
In order to do what you have explained in the image you can write your buttun2 action method like
button2.hidden = TRUE;
// Change y value (if you have all three buttons in vertical) of button 3 Frame Like:
CGRect btn3Frame = button3.frame;
btn3Frame.origin.y = button2.frame.origin.y;
button3.frame = btn3Frame;
// Change x value (if you have all three buttons in Horizontal) of button 3 Frame Like:
CGRect button3Frame = button3.frame;
button3Frame.origin.x = button2.frame.origin.x;
button3.frame = button3Frame;
If you got help from my answer then please accept it and up vote also.