IOS for simple frosted glass effect

Source: Internet
Author: User

Recently in the collation of the navigation bar gradually fade effect, finishing process by chance to learn the picture of the effect of the glass, very simple, not much to say, first look at the effect of comparison,

This is the original,

This is added after the effect, the creation of the image of the code is not up, below to see the code to add effects:

Frosted glass

/*

The system comes with three different styles

uiblureffectstyleextralight,//extra brightness, (highlight style)       uiblureffectstylelight,//light style       uiblureffectstyledark//dark style

*/

Uiblureffect *effect = [Uiblureffect effectwithstyle:uiblureffectstyledark];//Create the desired type of frosted glass effect

Uivisualeffectview *effectview = [[Uivisualeffectview alloc] initwitheffect:effect]; Create a frosted glass view

Effectview.frame = CGRectMake (0, 0, MSW, 260);

Effectview.alpha = 0.75;

[Self.scaleimageview addsubview:effectview];//added to a view that needs to achieve a frosted glass effect

You can set alpha for Effectview, and the effect:

can also be partially implemented frosted glass, only need to modify the Effectview frame can:

The simple frosted glass effect was realized. If you have enough, please give us a lot of advice

IOS for simple frosted glass effect

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.