系統(tǒng)毛玻璃效果
UIImageView * imageview = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"testImg"]];
imageview.userInteractionEnabled = YES;
imageview.contentMode = UIViewContentModeScaleAspectFit;
imageview.frame = CGRectMake(0, 80, 200, 200);
[self.view addSubview:imageview];
UIBlurEffect * blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
UIVisualEffectView * effectview = [[UIVisualEffectView alloc] initWithEffect:blur];
effectview.frame = CGRectMake(0, 0, imageview.frame.size.width, imageview.frame.size.height);
[imageview addSubview:effectview];
UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
button.frame = CGRectMake(10, 50, 60, 60);
[button setTitle:@"btn" forState:UIControlStateNormal];
[effectview.contentView addSubview:button];
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者