UIActivityIndicatorView 的高级可定制替代品
HZActivityIndicatorView 必须使用 ARC 编译,可能会很快添加一个支持经典内存管理的分支。
HZActivityIndicatorView 可用于替代 UIActivityIndicatorView,并支持 UIKit 指示器的默认样式。
HZActivityIndicatorView *activityIndicator = [[HZActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
[activityIndicator startAnimating];
一些额外的属性允许您进一步定制指示器
// size is automatically calculated using finSize and indicatorRadius,
// so no need to set it.
HZActivityIndicatorView *activityIndicator =
[[HZActivityIndicatorView alloc] initWithFrame:CGRectMake(50, 50, 0, 0)];
// set the number of "fins" in our indicator
activityIndicator.steps = 8;
// size of each fin
activityIndicator.finSize = CGSizeMake(17, 10);
// which corners are round
activityIndicator.roundedCoreners = UIRectCornerAllCorners;
// corner radius of fins
activityIndicator.cornerRadii = CGSizeMake(0, 0);
// radius of the inner circle
activityIndicator.indicatorRadius = 20;
// animation interval
activityIndicator.stepDuration = 0.1;
// indicator color
activityIndicator.color = [UIColor colorWithRed:85.0/255.0 green:0.0 blue:0.0 alpha:1.000];
// animation direction
activityIndicator.direction = HZActivityIndicatorDirectionCounterClockwise;
[activityIndicator startAnimating];
版权所有 © 2011 Hezi Cohen。保留所有权利。见 LICENSE 获取更多详情。