Search code examples
iosiphoneuiimageuicolor

Set blurred image background in iOS


I have an image as background of an ios app.

I want to make that image blurred using the iOS7 blur effect.

How can I achieve that? Minimum iOS version support of my iOS app is 6.0.


Solution

  • Your image will be in a UIImageView.

    You can use this code...

    self.theImageView.alpha = 0.5;
    

    just set the alpha to whatever you want.

    EDIT

    From the comments you are actually looking for the iOS 7 blur effect.

    This is very different from setting transparency.

    What you are looking for is the category available from here https://developer.apple.com/downloads/download.action?path=wwdc_2013/wwdc_2013_sample_code/ios_uiimageeffects.zip

    You will need to download the category then when you set the background just blur the image before putting it into the background pattern.