参考:https://stackoverflow.com/questions/28737772
如果UICollectionViewCell或者UITableViewCell里面有UIActivityIndicatorView,重用机制下的cell里UIActivityIndicatorView的转圈会停止。
需要在prepareForReuse重新启动。
Obj-C:
@interface SpinnerCell @property (weak) IBOutlet UIActivityIndicatorView *spinner; @end @implementation SpinnerCell - (void)prepareForReuse { [super prepareForReuse]; [self.spinner startAnimating]; } @end
Swift:
class SpinnerCell: UITableViewCell {
@IBOutlet weak var spinner: UIActivityIndicatorView?
override func prepareForReuse() {
super.prepareForReuse()
if let spinner = self.spinner {
spinner.startAnimating()
}
}
重用Cell里的UIActivityIndicatorView会停止
原文:https://www.cnblogs.com/liuyongfa/p/14278425.html