All Products
Search
Document Center

mPaaS customized loading control

Last Updated: May 25, 2021

AULoadingIndicatorView is a custom loading control of mPaaS.
The mPaaS custom loading control is migrated from the APActivityIndicatorView of APCommonUI. Use AULoadingIndicatorView instead of APActivityIndicatorView.

Sample image

auloadingindicatorview

API description

 
  1. typedef enum{
  2. AULoadingIndicatorViewStyleTitleBar, //Navigation bar loading box, diameter: 36 px, ring width: 3 px.
  3. AULoadingIndicatorViewStyleRefresh, //List loading box, diameter: 48px, ring width: 4px
  4. AULoadingIndicatorViewStyleToast, //Toast loading box, diameter: 72px, ring width: 6px
  5. AULoadingIndicatorViewStyleLoading, //Page loading box, diameter: 90px, ring width: 6px
  6. }AULoadingIndicatorViewStyle;
  7. /**
  8. The mPaaS-customized loading control.
  9. */
  10. @interface AULoadingIndicatorView : UIView
  11. @property (nonatomic, assign) BOOL hidesWhenStopped; //Whether to hide when stopped.
  12. @property (nonatomic, strong) UIColor *trackColor; //The color of the ring.
  13. @property (nonatomic, strong) UIColor *progressColor; //The color of the loading indicator.
  14. @property (nonatomic, assign) float progressWidth; //Set the width of the ring when customizing the ring size. Default value: 2.
  15. @property (nonatomic, assign) CGFloat progress; //The ratio of the arch length of the loading indicator to the perimeter of the ring. Default value: 0.1
  16. /**
  17. * The circlular loading box.
  18. * Note: If the default style is not used, define the size of the circle and use initWithFrame to initialize the circle. The default width of the ring is 2, which can be adjusted by setting progressWidth.
  19. *
  20. * @param style The current loading type.
  21. *
  22. */
  23. - (instancetype)initWithLoadingIndicatorStyle:(AULoadingIndicatorViewStyle)style;
  24. /**
  25. Start an animation.
  26. */
  27. - (void)startAnimating;
  28. /**
  29. End an animation.
  30. */
  31. - (void)stopAnimating;
  32. /**
  33. Whether an animation is being executed.
  34. @return YES: An animation is being executed. NO: No animation is being executed.
  35. */
  36. - (BOOL)isAnimating;
  37. @end

Sample code

 
  1. AULoadingIndicatorView *view = [[AULoadingIndicatorView alloc] initWithLoadingIndicatorStyle:AULoadingIndicatorViewStyleLoading];
  2. view.hidesWhenStopped = YES;
  3. view.center = CGPointMake(280, 250);
  4. view.trackColor = [UIColor redColor];
  5. view.progressColor = [UIColor blueColor];
  6. [view startAnimating];
  7. [self.view addSubview:view];