質問

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.

役に立ちましたか?

解決

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.

他のヒント

There is difference between transperency and translucency. You can adjust transperency by using 'alpha' property as mentioned by fogmeister. This will give you somewhat similar results.

AFAIK there is no direct API to apply translucency effect on image. Alternatively You can alter the image in external image editor tool eaisily and use it in your application.

Note : For image to have translucent effect, you need to have another image/text behind it.

set your imageView alpha value t 0.4 to 0.6

or

if you want dynamic blurred image background like below

enter image description here

FXBlurView

Simple Process:

  1. Use a png file as background image.
  2. Set this image's transparency level using photoshop.
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top