iOS系統自帶毛玻璃效果

UIImageView * imageview = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"屏幕快照 2015-12-18 下午10.51.33"]];
    imageview.
userInteractionEnabled = YES;
    imageview.
contentMode = UIViewContentModeScaleAspectFit;
    imageview.
frame = CGRectMake(0, 0, 375, 668);
    [
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];
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章