How to make your iPhone screen dim

I have an update button on my iphone screen that updates the table in the current view.

The screen refreshes beautifully, but is there a way to make the screen dim and then light up again after the table has refreshed?

+6
ios objective-c iphone cocoa-touch uikit
source share
2 answers

You can place an opaque view with a black background according to the view you want to smooth. By default, this value will have an alpha value of 0 and therefore will be transparent. Then you can use the UIView animation to set the black alpha representations from 0 to 0.5 (say), and then back.

Note. The code below has not been tested, but I used a similar effect to achieve the same effect.

... dimView.alpha = 0.0f; [UIView beginAnimations@ "fade" context:nil]; [UIView setAnimationDuration:0.5f]; [UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)]; [UIView setAnimationRepeatAutoreverses:YES]; dimView.alpha = 0.5f; [UIView commitAnimations]; ... } - (void) animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context { dimView.alpha = 0.0f; } 
+15
source share

Could you download a black, 50% alpha view on top, perhaps fade out?

+1
source share

All Articles