Guest User

Untitled

a guest
Jan 23rd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. -(void)showActivityViewer
  2. {
  3. self.activityView = [[[UIView alloc] initWithFrame: CGRectMake(0, 0, self.view.window.bounds.size.width, self.view.window.bounds.size.height)] autorelease];
  4. activityView.backgroundColor = [UIColor blackColor];
  5. activityView.alpha = 0.5;
  6.  
  7. self.activityWheel = [[[UIActivityIndicatorView alloc] initWithFrame: CGRectMake(self.view.window.bounds.size.width / 2 - 12, self.view.window.bounds.size.height / 2 - 12, 24, 24)] autorelease];
  8. activityWheel.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
  9. activityWheel.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin |
  10. UIViewAutoresizingFlexibleRightMargin |
  11. UIViewAutoresizingFlexibleTopMargin |
  12. UIViewAutoresizingFlexibleBottomMargin);
  13. [activityView addSubview:activityWheel];
  14. [self.view.window addSubview: activityView];
  15. [[[activityView subviews] objectAtIndex:0] startAnimating];
  16. }
  17.  
  18. -(void)removeActivityViewer {
  19. [activityWheel removeFromSuperview];
  20. [activityView removeFromSuperview];
  21. self.activityWheel = nil;
  22. self.activityView = nil;
  23. }
Add Comment
Please, Sign In to add comment