Problems animating UIView alpha

后端 未结 6 1974
野趣味
野趣味 2020-12-06 19:17

I\'m trying to apply a fade to an UIView I created programmatically on the top of another.

[UIView animateWithDuration:0.5 animations:^(void) {
    [self.vie         


        
6条回答
  •  遥遥无期
    2020-12-06 19:43

    I ran into the exact problem. In my case, I wanted the view to be hidden at first, so I set hidden to true. I thought changing the alpha value changes hidden property automatically, but that wasn't the case.

    So, if you want the view to be hidden at first, set its alpha to 0.

提交回复
热议问题