Failed to resize activity indicator in iOS 5.0?

In my universal application in the part of iPAd I change the size of the activity indicator ...

I want to change the size of the activity indicator.

But there are really problems with iOS first here is my code ...

-(void)startSpinner { spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; /*spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; */ spinner.hidden = NO; NSLog(@"Start Spinner"); if([self isPad]) spinner.frame = CGRectMake(self.view.frame.size.width/2, self.view.frame.size.height/2,100, 100); else spinner.frame = CGRectMake(self.view.frame.size.width/2, self.view.frame.size.height/2,50, 50); NSLog(@"Dpinner size %f",spinner.frame.size.width); [spinner setHidesWhenStopped:YES]; [self.view addSubview:spinner]; [self.view bringSubviewToFront:spinner]; /*1*/ **[spinner setColor:[UIColor blackColor]];** [spinner startAnimating]; } 

Problem 1:

iOS 5.0: it shows me an activity indicator, but cannot resize it. The size does not change in the isPAd method.

iOS 4.3: This gives me a cancel error message when the color changes. / 1 / Bolded Line in the code for setting the color. Here If I delete setColor in iOS 5.0 in WhiteLargeStyle , it will not show me on a white background.

Here, if I use the Activity Indicator style, for example gray , it is quite small in iPAd.works, but cannot resize.

In iOS 4.3, frames get effects, but ios 5.0 frames are not effective ...

So, how do I resize the activity indicator ...

+7
ios objective-c iphone cocoa-touch
Dec 21 '11 at 6:05
source share
4 answers

Consider using custom progress indicators, as this will provide more flexibility.

I use MBProgressHUD and it is simple and great for me.

You can get it here - https://github.com/jdg/MBProgressHUD

+4
Dec 21 '11 at 6:14
source share

Try setting the CGAffineTransform activity indicator:

  CGAffineTransform transform = CGAffineTransformMakeScale(1.5f, 1.5f); activityIndicator.transform = transform; 
+63
Dec 21 2018-11-11T00:
source share

Take it out in your iPad app and it works great on ios

 CGRect frame = CGRectMake(300,75,100,100); UIActivityIndicatorView *act = [[UIActivityIndicatorView alloc] initWithFrame:frame]; [act startAnimating]; act.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray; //[act sizeToFit]; act.tag=kActTag; mainImage.enabled=TRUE; [mainImage addSubview:act]; [act release]; act=nil; 
0
Dec 21 '11 at 6:15
source share

@Arpit

The color property is available for iOS 5.0 and later. An error is expected in iOS4.3!

See http://developer.apple.com/library/ios/#documentation/uikit/reference/UIActivityIndicatorView_Class/Reference/UIActivityIndicatorView.html

thank

0
Dec 21 '11 at 20:19
source share



All Articles