Method One: Support all iOS system versions:
-(void) Setupblurview
{
Uiimageview *darkview = [[Uiimageview alloc] init];
Darkview.frame = Self.view.bounds;
UIImage *image = [UIImage imagewithdata:_hotmodel.picdata];
Darkview.image = image;
Darkview.backgroundcolor = [Uicolor Clearcolor];
[Self.view Addsubview:darkview];
_darkview = Darkview;
Uitoolbar *toolbar = [[Uitoolbar alloc] init];
[ToolBar Setbarstyle:uibarstyleblack];
[Darkview Addsubview:toolbar];
Toolbar.translatesautoresizingmaskintoconstraints = NO;
[ToolBar mas_makeconstraints:^ (Masconstraintmaker *make) {
Make.edges.equalTo (Darkview);
}];
}
Method Two: Only in the ios8.0 above has the effect, using the system's API implementation
-(void) addeffectview{
Uiimageview *darkview = [[Uiimageview alloc] init];
Darkview.frame = Self.view.bounds;
UIImage *image = [UIImage imagewithdata:_hotmodel.picdata];
Darkview.image = image;
Darkview.backgroundcolor = [Uicolor Clearcolor];
[Self.view Addsubview:darkview];
_darkview = Darkview;
Uiblureffect *dark = [Uiblureffect Effectwithstyle:uiblureffectstyledark];
Uivisualeffectview *effectview = [[Uivisualeffectview alloc] initwitheffect:dark];
Effectview.frame = Self.view.bounds;
[Darkview Addsubview:effectview];
}
:
iOS frosted glass effect