iOS UIButton按钮颜色渐变动画

   self.rotateButton.imageView.alpha = 0.2;
 
    [UIView animateWithDuration:0.2
                     animations:^{
                         self.rotateButton.imageView.alpha = 0.5;
                     }completion:^(BOOL finish){
                         [UIView animateWithDuration:0.2
                                          animations:^{
                                              self.rotateButton.imageView.alpha = 0.7;

                                          }completion:^(BOOL finish){
                                              self.rotateButton.imageView.alpha = 1.0;

                                          }];
                     }];

}


    [UIView animateWithDuration: 0.15 delay: 0 options: UIViewAnimationOptionCurveEaseInOut animations: ^{

        [self rotateLocation:pLocation];
        self.rotateButton.imageView.alpha = 0.5;

    } completion: ^(BOOL finished) {
        [UIView animateWithDuration: 0.15 animations: ^{
            self.rotateButton.imageView.alpha = 1.0;
        }];
    }];


你可能感兴趣的:(iOS开发经验)