views:

650

answers:

4

Hi, alt text

Can anyone tell me how to achieve such loading message? is it some variation of UIActivityIndicatorView? thanks peter

+1  A: 

The spinning wheel is definitely a UIActivityIndicatorView. The "Loading..." text is a UILabel, the rectangle could be an image or could be a UIView with rounded corners (via CALayer). Any questions about the rest of the message? T

Seva Alekseyev
A: 

If you're looking for existing solutions you may use three20 library - they have implemented this functionality in TTActivityLabel class.

Vladimir
+2  A: 

Something similar to the following in your initWithFrame of your custom subclassed UIView:

    _hudView = [[UIView alloc] initWithFrame:CGRectMake(75, 155, 170, 170)];
    _hudView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5];
    _hudView.clipsToBounds = YES;
    _hudView.layer.cornerRadius = 10.0;

    _activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
    _activityIndicatorView.frame = CGRectMake(65, 40, _activityIndicatorView.bounds.size.width, _activityIndicatorView.bounds.size.height);
    [_hudView addSubview:_activityIndicatorView];
    [_activityIndicatorView startAnimating];

    _captionLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 115, 130, 22)];
    _captionLabel.backgroundColor = [UIColor clearColor];
    _captionLabel.textColor = [UIColor whiteColor];
    _captionLabel.adjustsFontSizeToFitWidth = YES;
    _captionLabel.textAlignment = UITextAlignmentCenter;
    _captionLabel.text = @"Loading...";
    [_hudView addSubview:_captionLabel];

    [self addSubview:_hudView];
bstahlhood
A: 

Try http://github.com/jdg/MBProgressHUD

Mugunth Kumar