0

I have two views, a designated superview and a subview. The subview has an alpha value of 0 and has only been initialized and not been added to any superview. After the configuration of my subview I declare a UIView animation block. With this, I change the alpha of the subview to 1.0 within less than a second.

Right after I declare the animation I add the subview to my superview X.

Is it possible that the animation won't happen – and if so, why?

[UIView animateWithDuration:0.3 animations:^(void) {
        [aSubview setAlpha:1.0];
}];

[aSuperview addSubview:aSubview];
ff10
  • 3,046
  • 1
  • 32
  • 55
  • What makes you think it wouldn't animate? – Paul.s Dec 19 '12 at 22:04
  • I have exactly this problem and I guess the reason for that is that the sequence is wrong. I think it would be correct to add the subview and then animate, not vice versa. But I wasn't sure if that really matters. – ff10 Dec 20 '12 at 09:40

0 Answers0