JiteshW
JiteshW

Reputation: 2205

UIActivityIndicator not appearing in iOS 5

I had successfully implemented activity indicator in my app, was working properly on simulator as well as on device also. Recently I upgraded my Device's OS from 4 to 5. since than I cannot see activity indicator which was appearing earlier.

My simulator supports is till OS 4.2 only, and it displays activity indicator properly. On device it not showing may be because of OS 5.

I have used IB to create activity indicator.

Thanks, Jitesh

Upvotes: 0

Views: 703

Answers (3)

Ashley Mills
Ashley Mills

Reputation: 53121

I'm guessing the hidesWhenStopped property is set to YES, and the activity indicator is not animating.

Either set hidesWhenStopped to NO (to show it all the time), or make sure you call:

[self.activityIndicator startAnimating];

Upvotes: 2

Vinay
Vinay

Reputation: 171

hope this will work---

UIActivityIndicatorView *activityIndicator; //declare it as globaly

   CGFloat width = 40;
    CGFloat height = 40;
    CGRect centeredFrame = CGRectMake(500, 150, width, height);
    activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:centeredFrame];
    activityIndicator.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5];
    [self.view addSubview:activityIndicator];

Upvotes: 0

iamsult
iamsult

Reputation: 1579

Just check the style properties, in some cases the white and gray doesn't work, like in ios 5 the below style is workable for me.

activityStyle = UIActivityIndicatorViewStyleWhiteLarge; 

Upvotes: 1

Related Questions