84669 personnes étudient
152542 personnes étudient
20005 personnes étudient
5487 personnes étudient
7821 personnes étudient
359900 personnes étudient
3350 personnes étudient
180660 personnes étudient
48569 personnes étudient
18603 personnes étudient
40936 personnes étudient
1549 personnes étudient
1183 personnes étudient
32909 personnes étudient
场景:存在一个UILabel实例,对它做缩放,如何清除知道他正在缩放?
小伙看你根骨奇佳,潜力无限,来学PHP伐。
Il n'existe aucune API pertinente permettant de déterminer si l'animation est en cours d'exécution. Il existe uniquement la méthode suivante, qui peut être déterminée en jugeant isAnimating
// 设置初始值(最好使用全局或者属性) __block BOOL isAnimating =YES; self.transform = CGAffineTransformMakeScale(6, 6); [UIView animateKeyframesWithDuration:0.333 delay:0 options:0 animations:^{ self.transform = CGAffineTransformMakeScale(1, 1); } completion:^(BOOL finished) { // 成功回调改为NO isAnimating = NO; completion(); }];
-(BOOL)isAnimated { BOOL animated = self.layer.animationKeys.count > 0; for (UIView *subView in self.subviews) { animated |= subView.isAnimated; } return animated; }
Personnellement, il est préférable d'utiliser l'attribut bool de label pour enregistrer
Il n'existe aucune API pertinente permettant de déterminer si l'animation est en cours d'exécution. Il existe uniquement la méthode suivante, qui peut être déterminée en jugeant isAnimating
.Personnellement, il est préférable d'utiliser l'attribut bool de label pour enregistrer