Try setting the center property of your activity type, for example:
activity.center = CGPointMake(self.view.frame.size.width/2,self.view.frame.size.height/2);
viewDidLoad in viewDidLoad for device rotation notifications:
- (void)viewDidLoad { [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didRotate:) name:UIDeviceOrientationDidChangeNotification object:nil]; }
and implement didRotate:
-(void)didRotate:(NSNotification *)notification { if (activity) { activity.center = CGPointMake(self.view.frame.size.width/2,self.view.frame.size.height/2); } }
sudo rm -rf
source share