UIImageView animation automatically stops

Recently, when LOADING animation with UIImageView animationImages, the animation inexplicably stops by itself

It turns out that there are two causes

1. When you switch views, such as UIViewController push and UITabViewController push, this will trigger willMoveToWindow, causing the animation to stop

The solution

-(void)willMoveToWindow:(UIWindow*)newWindow{[superwillMoveToWindow:newWindow]; if(newWindow){if(self.loading){[self.loadingImageView startAnimating]; }}}

2. If loading is placed on a UITableViewCell or UICollectionViewCell, clicking the cell will highlight the UIImageView and the animation will stop

The solution

@ interfaceSeaLoadingImageView: UIImageView are / / / loading @ property (nonatomic, assign) BOOL loading; @end

@implementationSeaLoadingImageView

-(void)setHighlighted:(BOOL)highlighted{

[supersetHighlighted:highlighted];

if(self.loading&&! self.isAnimating){

[selfstartAnimating];

}

}

@end

The width of each item is inconsistent with the width of the collectionView

Github.com/yangguanghe…

WSL_RollView is based on UICollectionView to support horizontal and vertical two directions of the paging and progressive circular effect, can set the time interval, progressive rate, whether to cycle, paging width and interval, but also support high custom paging view controls.

Github.com/wsl2ls/WSL_…

Gold digging APP personal center page style

Github.com/wsl2ls/iOS_…

  • (void)getData {

    [self.titlesArray addObjectsFromArray:@[

    Personal center page style "@" nuggets APP, @ "weibo page found ScrollView nested style", @ "Jane books APP personal center page style"]].Copy the code

    [self.classArray addObjectsFromArray:@[[SLScrollViewJuejin class],

                                         [SLScrollViewWeiboclass],
    
                                         [SLScrollViewJianShuclass]]];
    Copy the code

    [self.tableView reloadData];