ios - show UIView with an overlay -


in app, have uiview uibutton in it. now, when user touches button, i'd blurred overlay appear uiview in it. added code below in uiview subclass that:

uiblureffect *blureffect = [uiblureffect effectwithstyle:uiblureffectstylelight];  self.overlay = [[uivisualeffectview alloc] init]; [self.overlay setframe:[[uiscreen mainscreen] bounds]];  cgrect newframe = [self convertrect:self.bounds toview:self.overlay]; nslog(@"newframe.origin.x: %f", newframe.origin.x); nslog(@"newframe.origin.y: %f", newframe.origin.y); self.frame = newframe; nslog(@"self.frame: %f", self.frame.origin.x); nslog(@"self.frame: %f", self.frame.origin.y); [self.overlay.contentview addsubview:self]; nslog(@"self.frame: %f", self.frame.origin.x); nslog(@"self.frame: %f", self.frame.origin.y); self.frame = newframe;  [self.overlay.contentview addsubview:self.dropdown];  [[[uiapplication sharedapplication] keywindow] addsubview:self.overlay]; [uiview animatewithduration:0.4 animations:^{     self.overlay.effect = blureffect; }]; 

now, because view inside view has origin.x of 10. that's why convert point in complete screen. however, isn't working , view shown @ top of page. ideas i'm doing wrong?


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -