Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to set / increase the size of UIActivityindicator view

I m trying to set size of UIActivityindicatorview using setframe. It is able to set position but not size of control. is there some other way??

This is relevant code.

 UIActivityIndicatorView*  mySpinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
    mySpinner.frame=CGRectMake((375/2)-25,210 , 100, 100);
    mySpinner.color=[UIColor blueColor];
     mySpinner.center =self.view.center;
   mySpinner.hidesWhenStopped = YES;
    [self.view addSubview:mySpinner];
like image 357
ayna Avatar asked Aug 06 '15 05:08

ayna


1 Answers

What i did to change the ActivityIndicator size in app is:

Just Apply the Transform on your activity indicator and Rescale it.

Here is the code

UIActivityIndicatorView*  mySpinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
mySpinner.transform = CGAffineTransformMakeScale(1.5, 1.5);
mySpinner.color=[UIColor blueColor];
mySpinner.center =self.view.center;
mySpinner.hidesWhenStopped = YES;
[self.view addSubview:mySpinner];
like image 59
M Zubair Shamshad Avatar answered Sep 25 '22 19:09

M Zubair Shamshad