Different type of Custom Activity Indicator or Spinner

ranjeet

Customising UIActivityIndicatorView

iOS SDK support only one type of activity indicators (spinner) with fixed size. For effective iOS App Development, iOS5 and above support for customising the colour of the spinner.

1
2
3
4
UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
activityIndicator.hidesWhenStopped = NO;
<strong>[activityIndicator setColor:[UIColor redColor]];</strong>
[activityIndicator release];

Creating different types of ActivityIndicator Or Spinner

Implementation of spinners

TJSppiner has ability to achieve or change colour, size pattern, image, rotation speed etc.

1. Implementation of line base spinners (similar as iOS Activity indicator).
A. You can change inner and outer radius of spinner
B. You can change number of line to be appear in the circle of the spinner.
C. You can change appearance of spinner using its property like colour, pattern, caps/stork, image etc…

1
2
3
4
5
6
7
8
9
10
 TJSpinner *spinner = [[TJSpinner alloc] initWithSpinnerType:kTJSpinnerTypeActivityIndicator];
spinner.hidesWhenStopped = YES;
[spinner setColor:[UIColor blackColor]];
[spinner setInnerRadius:15];
[spinner setOuterRadius:35];
[spinner setStrokeWidth:6];
[spinner setNumberOfStrokes:8];
[spinner setPatternLineCap:kCGLineCapButt];
[spinner setPatternStyle:TJActivityIndicatorPatternStyleDot];
[spinner release];

2. Implementation of BeachBall spinners (similar as iMAC desktop beach ball).
A. You can change radius (size) of the beach ball.

1
2
3
4
TJSpinner *beachBallSpinner = [[TJSpinner alloc] initWithSpinnerType:kTJSpinnerTypeBeachBall];
beachBallSpinner.hidesWhenStopped = YES;
[beachBallSpinner setRadius:20];
[beachBallSpinner release];

3. Implementation of Circular spinners (similar as web).
A. You can change radius (size) of the Circular spinners.

1
2
3
4
5
6
7
TJSpinner *circularSpinner = [[TJSpinner alloc] initWithSpinnerType:kTJCircularSpinner];
circularSpinner.hidesWhenStopped = YES;
circularSpinner.radius = 10;
circularSpinner.pathColor = [UIColor whiteColor];
circularSpinner.fillColor = [UIColor redColor];
circularSpinner.thickness = 7;
[circularSpinner release];

Output:iOS Custom Activity indicator or spinner
Download source code Of custom spinner from git

Google Certified Agency

about the author

ranjeet

  1. Jo27785

    February 20, 2013

    I do agree with all of the ideas you have unfilled in your send. They¡¯re fantastically influential and will definitely labor. Immobile, the posts are very succinct for novices. May possibly you entertain enlarge them a little commencing next time? Thanks for the post.

  2. Mounika Varma

    April 26, 2013

    Good tutorial

  3. Jatiender Kumar

    August 2, 2013

    good but…………sooooooo sooooooo.

  4. Алексей Строкин

    September 3, 2013

    Good but need performance tuning. Why you redraw every time, I think it will be much better to transform layers, for almost all spinners no need to redraw.

  5. Pravin Fand

    November 20, 2013

    Awesome Spinner control. Thanks!!!!

  6. Dilip Paithankar

    November 21, 2013

    good one !!!

  7. Click For Info

    December 21, 2013

    Your own personal capability and kindness in dealing with this subject was very useful!

  8. Venki Injarapu

    March 31, 2014

    nice