博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
制作毛玻璃效果 分类: ios技术 2015-07-...
阅读量:7224 次
发布时间:2019-06-29

本文共 853 字,大约阅读时间需要 2 分钟。

 //添加一个图片
    UIImageView *imageview = [[UIImageView alloc]init];
    imageview.frame = CGRectMake(10, 100, 300, 300);
    
    imageview.contentMode = UIViewContentModeScaleAspectFit;
    
    imageview.userInteractionEnabled = YES;
    
    imageview.image = [UIImage imageNamed:@"3.jpg"];
    
    [self.view addSubview:imageview];
    
    //模糊效果代码
   UIBlurEffect *errect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleExtraLight];
    UIVisualEffectView *ectView = [[UIVisualEffectView alloc]initWithEffect:errect];
    ectView.alpha = 0.6;
    
   ectView.frame = CGRectMake(0, 0, imageview.frame.size.width/2, 300);
    
    
    [imageview addSubview:ectView];
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeSystem];
    
    btn.frame =CGRectMake(10,50, 100, 40);
    [btn setTitle:@"btn"forState:UIControlStateNormal];
    [ectView.contentView addSubview:btn];

版权声明:本文为博主原创文章,未经博主允许不得转载。

转载于:https://www.cnblogs.com/liuqixu/p/4683964.html

你可能感兴趣的文章
logback logback.xml常用配置详解(三) <filter>
查看>>
KgMall B2B/B2B2c/C2C版店铺商号初始化
查看>>
Linux内核的ioctl函数学习
查看>>
Liunx Shell入门
查看>>
Thread的中断
查看>>
linux --- 内存管理
查看>>
PostgreSQL
查看>>
CPU 超线程、多核
查看>>
用ASCII码显示string.xml中的特殊字符
查看>>
网站301跳转到新域名
查看>>
codewars020: The Clockwise Spiral 数字顺时针螺旋矩阵
查看>>
ios 下拉刷新
查看>>
Django在Windows系统下的安装配置
查看>>
懒到极致:对mybatis的进一步精简
查看>>
Android学习之OTA Update
查看>>
Maven Multi-environment package
查看>>
JMM-java内存模型
查看>>
iOS的soap应用(webservice) 开发
查看>>
Delphi listview 点击列头排序
查看>>
android preference page
查看>>