を下げる/成長:アニメーションは、私は次のようにCGAffineTransformMakeScaleを使用してカスタムボタンをアニメーション化しようとしているサイズImageViewのiOSの
if (stateButton == 0) { //The button is gonna appear
self.selected = YES;
self.imageView.transform = CGAffineTransformMakeScale(0.01, 0.01);
[UIView animateWithDuration:0.5 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
// animate it to the identity transform (100% scale)
self.imageView.transform = CGAffineTransformIdentity;
} completion:nil];
}
else if (stateButton ==1) { //The button is gonna disappear
self.imageView.transform = CGAffineTransformMakeScale(1, 1);
[UIView animateWithDuration:0.5 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
// decrease button
self.imageView.transform = CGAffineTransformMakeScale(.01, .01);
} completion:^(BOOL finished){
self.selected = NO;
}];
}
ボタンが元のサイズに完全に成長し、しかし、私は理由を知りませんが、ボタンをクリックすると、元のサイズの100%より大きなサイズから元のサイズに縮小されず、コードに示されているように0.01のスケールになります。
助けてください!
素晴らしい親愛なります! –