zoukankan      html  css  js  c++  java
  • 制作毛玻璃效果

     //加入一个图片
        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];
  • 相关阅读:
    开发进度1
    人月神话阅读笔记(1)
    仓库管理系统
    课程管理系统教程
    流与文件课后作业2加解密工作
    流与文件课后作业3
    今日学习时间记录
    Java字符串切片
    java_ 集合
    json基础教程|理解Json
  • 原文地址:https://www.cnblogs.com/liguangsunls/p/7290620.html
Copyright © 2011-2022 走看看