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
Post a Comment