A sudden whim last night, studied the effect of the glass under the iOS 8, feel pretty. Give a person a hazy beauty, so the hands-on implementation of the Code. ---to the natural resources of bird diagram review through everyone can not download, very sorry. But the truth is the same, there are pictures everywhere. The most important thing is to grasp the knowledge point. Haha, then we will study today's wool glass effect bar.
#import "ViewController.h"
@interface viewcontroller ()
{
uiimageview *_imageview;
}
@end
@implementation Viewcontroller
-(void) viewdidload {
[superviewdidload];
[selfcreateview];
[selfcreatevisualefview];
}
-(void) CreateView
{
uiimageview *imageview = [[uiimageviewalloc] initwithframe:cgrectmake(50 , (+-)];
[ImageView setimage: [UIImageimagenamed:@ " Webwxgetmsgimg.jpg "];
[self. View addsubview: ImageView];
_imageview = ImageView;
}
// Create a visual view
-(void) Createvisualefview
{
uivisualeffectview *vis =[[uivisualeffectviewalloc] initwitheffect: [uiblureffecteffectwithstyle: Uiblureffectstyleextralight ]]; // There are three ways to invoke it.
Vis. Frame = CGRectMake (0,0 , +);
Vis. Alpha = 1.0 ;
[_imageviewaddsubview: Vis];
}
There are a total of 3 kinds of effects, we can go inside the method to see, we have to explore and adventure spirit is not it.
iOS frosted glass effects