Skip to content

Instantly share code, notes, and snippets.

@arielelkin
Created May 31, 2012 14:48
Show Gist options
  • Save arielelkin/2843907 to your computer and use it in GitHub Desktop.
Save arielelkin/2843907 to your computer and use it in GitHub Desktop.
Adding a loading wheel on top of some translucent shit
//You probably won't be able to use "self" in OF,
//so I'll let you figure out how to obtain the device's
//the width and height from OF
float screenWidth = self.view.frame.size.width;
float screenHeight = self.view.frame.size.height;
UIView *translucentShit = [[UIView alloc] initWithFrame:CGRectMake(0, 0, screenWidth, screenHeight)];
[translucentShit setBackgroundColor:[UIColor blackColor]];
translucentShit.alpha = 0.3; //set the transparency here
[self.view addSubview:translucentShit];
UIActivityIndicatorView *loadingWheel = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
loadingWheel.center = CGPointMake(screenWidth/2, screenHeight/2);
[self.view addSubview:loadingWheel];
[loadingWheel startAnimating];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment