All Products
Search
Document Center

Mobile Platform as a Service:mPaaS customized loading control

Last Updated:Jul 18, 2023

  • AULoadingIndicatorView is a custom loading control of mPaaS.

  • The mPaaS-customized loading control is migrated from the APActivityIndicatorView of APCommonUI. Use latest AULoadingIndicatorView.

API description

typedef enum{
AULoadingIndicatorViewStyleTitleBar,   //Navigation bar loading box, diameter: 36 px, ring width: 3 px.
AULoadingIndicatorViewStyleRefresh,    //List loading box, diameter: 48px, ring width: 4px
AULoadingIndicatorViewStyleToast,      //Toast loading box, diameter: 72px, ring width: 6px
AULoadingIndicatorViewStyleLoading,    //Page loading box, diameter: 90px, ring width: 6px
}AULoadingIndicatorViewStyle;



/**
The mPaaS-customized loading control. 
*/
@interface AULoadingIndicatorView : UIView

@property (nonatomic, assign) BOOL    hidesWhenStopped;    //Whether to hide when stopped.
@property (nonatomic, strong) UIColor *trackColor;         //The color of the ring.
@property (nonatomic, strong) UIColor *progressColor;      //The color of the loading indicator.
@property (nonatomic, assign) float progressWidth;         //Set the width of the ring when customizing the ring size. Default value: 2.
@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

/**
* The circlular loading box.
* 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.
*
* @param style  The current loading type. 
*
*/
- (instancetype)initWithLoadingIndicatorStyle:(AULoadingIndicatorViewStyle)style;

/**
Start an animation.
*/
- (void)startAnimating;

/**
End an animation.
*/
- (void)stopAnimating;

/**
Whether an animation is being executed.

@return YES: An animation is being executed. NO: No animation is being executed.
*/
- (BOOL)isAnimating;


@end

Code sample

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