UIVisualEffectView will add a transparency and blur effect to iOS 8+ views. A.
Three blur UIBlurEffectStyles are available .
- (void)addBlurEffect{ CGRect bounds = self.navigationController.navigationBar.bounds; UIVisualEffectView *visualEffectView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]]; visualEffectView.frame = bounds; visualEffectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [self.navigationController.navigationBar addSubview:visualEffectView]; self.navigationController.navigationBar.backgroundColor = [UIColor clearColor]; [self.navigationController.navigationBar sendSubviewToBack:visualEffectView]; }
For more information about UIVisualEffectView , check out this question on SO .
*************** EDIT FOR iOS 7 ****************
Nicklockwood FXBlurView came to the rescue image for iOS5 , iOS6 , iOS7 .
I am creating a sample project for you that has the desired dynamic blur effect in the navigation bar for iOS7. Follow the guide below to use it in your project.
- Take a look at
AppDelegate.m - Here I add the background image to the navigation bar. You can refresh the image in any view manager to get a dynamic blur background image in the navigation bar.
- There are several properties of FXblurview, such as
blurRadius , iterations , tintColor ; which you should read here .
Installation Guide: - https://github.com/nicklockwood/FXBlurView?source=c#installation
The full source code for FXBlurView-master can be found here .
source share