Domanda

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 )

È stato utile?

Soluzione

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
    ];
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top