Pregunta

Here's one, when a certain screen arrives,

[UIView animateWithDuration:20 animations:^
        { self.view.backgroundColor =
        [UIColor colorWithHue:0 saturation:0 brightness:0.97 alpha:1];
        }];

I want to very slowly, take it from white to soft white.

Bizarrely - if you add this to a view, it crashes any scroll views (table views, collection views) you happen to have there, I think on that view or indeed just anywhere on screen. (The slow fade works fine!)

Try it on any fullscreen view.

Has anyone noticed this? Thoughts? Cheers

PS just incidentally, very slowly going to off-white for the whole screen is a great design look, particularly on retina iPad. (Breaking any tables is not so good though :O )

¿Fue útil?

Solución

Here's an example of rdelmar's tip!

[UIView animateWithDuration:1
    delay:0.0
    options:UIViewAnimationOptionAllowUserInteraction
    animations:^
    { c.backgroundColor=[[UIColor whiteColor] colorWithAlphaComponent:0.5];}
    completion:nil
    ];
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top