Do this : label.center = CGPointMake(view.center.x, view.center.y - 100);
.
Move UILabel's center up in UIView.
-
31-05-2022 - |
Question
I am trying to create a UILabel and I am setting it to the center of the view using label.center = view.center
. But I want to move it up by 100 pixels.
How would I go by doing this?
Something like, label.frame = CGRectMake(current-x, 100, 42, 21);
Is this possible? Keep x
the same but change the y
?
Solution
OTHER TIPS
CGRect frame = view.center;
frame.origin.x -= 100.0;
label.frame = frame;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow