【发布时间】:2018-07-09 08:41:34
【问题描述】:
我想在我的应用程序中有一个模糊的背景并查看弹出窗口。但是当我点击我的按钮时,没有出现模糊背景和视图......谁能帮我完成这个任务...... 我的代码是
- (IBAction)ButtonTouched:(id)sender {
if(!UIAccessibilityIsReduceTransparencyEnabled()){
self.view.backgroundColor = [UIColor clearColor];
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
UIVisualEffectView *blureffectview = [[UIVisualEffectView alloc]initWithEffect:blurEffect];
blureffectview.frame = self.view.bounds;
blureffectview.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
//[self.view addSubview:blureffectview];
[self.view insertSubview:_AnimatedViewForLoading aboveSubview:blureffectview];
}else{
//self.view.backgroundColor = [UIColor blackColor];
}
UIView * AnimatedViewForLoading;
// [[UIView alloc] initWithFrame:CGRectMake(118, 318, 200, 150)];
self.AnimatedViewForLoading.frame = CGRectMake(118, 318, 200, 150);
[self.AnimatedViewForLoading setBackgroundColor:[UIColor blueColor]];
self.AnimatedViewForLoading.alpha = 0.0f;
//AnimatedViewForLoading.backgroundColor = UIColor.lightGrayColor;
self.AnimatedViewForLoading.transform = CGAffineTransformMakeScale(0.01, 0.01);
[self.view addSubview:self.AnimatedViewForLoading];
[UIView animateWithDuration:0.2 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
self.AnimatedViewForLoading.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.1, 1.1);
} completion:^(BOOL finished) {
NSLog(@"oopssssss..........");
[UIView animateWithDuration:0.3/2 animations:^{
self.AnimatedViewForLoading.transform = CGAffineTransformIdentity;
}];
}];
}
【问题讨论】:
标签: ios objective-c uiview uivisualeffectview