The main implementation code is as follows:
self.rateinfoview is a well-defined control property control
Can change the transparency value to change the transparent effect of the glass
//virtual Transaction Rate pop -up window- (void) showrateinfo{Self.rateinfoview=[[UIView alloc]initwithframe:self.windowview.frame]; //Rateinfoview.backgroundcolor = [Uicolor blackcolor];Self.rateInfoView.alpha =0. F; [Self.view AddSubview:self.rateInfoView]; //create the desired type of frosted glass effectUiblureffect*blureffect =[Uiblureffect Effectwithstyle:uiblureffectstyledark]; //Frosted glass ViewUivisualeffectview*effectview =[[Uivisualeffectview alloc] initwitheffect:blureffect]; //add to a control that will have a frosted glass effectEffectview.frame=Self.windowView.frame; [Self.rateinfoview Addsubview:effectview]; //set Blur transparencyEffectview.alpha=. 8f; Uiimageview*rateimage = [[Uiimageview alloc]initwithframe:cgrectmake (width*0.1, (height-width*0.8*1.11)/2+ -, width*0.8, width*0.8/1.11)]; Rateimage.image= [UIImage imagenamed:@"Virtual rate pop -up window"]; [Self.rateinfoview Addsubview:rateimage]; UIButton*closeinfo =[UIButton Buttonwithtype:uibuttontypecustom]; Closeinfo.frame= CGRectMake (width*0.9- A- A, (height-width*0.8*1.11)/2+ -+ A, A, A); [Closeinfo setimage:[uiimage imagenamed:@"Cancel"] Forstate:uicontrolstatenormal]; [Closeinfo addtarget:self Action: @selector (Closerate) forcontrolevents:uicontroleventtouchupinside]; [Self.rateinfoview Addsubview:closeinfo]; [UIView animatewithduration:0.2animations:^{Self.rateInfoView.alpha=1.0f; }]; }- (void) closerate{[Self.rateinfoview Removefromsuperview]; }
:
iOS development--Transparent glass