1

I'm trying to center a UIButton to rootView. I've tried with this code:

self.startNewCross.center = CGPointMake(self.view.center.x, self.startNewCross.frame.origin.y);

but it doesn't work, then I've tried to center the background image to UIButton

self.startNewCross.imageView.contentMode = UIViewContentModeCenter;

but the uibutton is fixed on left. How to move the uibutton? I've other elements and the I move it without problem

Thanks a lot

Giulio
  • 221
  • 2
  • 15

1 Answers1

1

You can try this

[self.startNewCross setCenter:self.view.center]

This Will Helps You....

Mubin Mall
  • 546
  • 10
  • 25