I just did something similar today. I'm going to make it a suitable subclass, but for now this should get you started. Adding UILabel should be easy for you. I do this with ARC, so if you need to manage memory, be careful.
UIView *activityContainer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)]; activityContainer.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:.25]; UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake((self.view.frame.size.width/2) - 40, (self.view.frame.size.height/2) - 40, 80, 80)]; indicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge; indicator.backgroundColor = [UIColor blackColor]; [indicator layer].cornerRadius = 8.0; [indicator layer].masksToBounds = YES; [activityContainer addSubview:indicator];
source share