Fade In Fade Out Animation

后端 未结 13 1167
生来不讨喜
生来不讨喜 2021-01-30 01:45

Here is some code I struggle with for a while.

If you start the fade in animation, the label text fades in. If I start the fade out animation the the label text fades ou

13条回答
  •  感情败类
    2021-01-30 02:00

    you can do something like this (check possible parameters values and similar methods here : https://developer.apple.com/library/ios/documentation/uikit/reference/uiview_class/uiview/uiview.html

    [UIView animateWithDuration:duration
                          delay:delay
                        options:option 
                     animations:^{
                         //fade in here (changing alpha of UILabel component)
                     } 
                     completion:^(BOOL finished){
                        if(finished){
                          //start a fade out here when previous animation is finished (changing alpha of UILabel component)
                     }];
    }
    

提交回复
热议问题