How to programmatically set the position of a button in ios with Swift -


i'm doing this:

startbutton.frame = cgrectmake(0, 0, startbutton.frame.width, startbutton.frame.height) 

in viewdidload. seems make no difference.

what correct way of doing such thing?

use change position if not usign autolayout,

var x_position:cgfloat? = 50.0 //use x position here var y_position:cgfloat? = 50.0 //use y position here  startbutton.frame = cgrectmake(x_position, y_position, startbutton.frame.width, startbutton.frame.height) 

Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -