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

    感觉这种效果可以加在导航栏上,让UIVisualEffectView的透明度跟tabview的滑动绑定,这样实现一个动态效果,具体实现懒得写了,只有毛玻璃效果的对比图:

    //

    //  ViewController.m

    //  effectView

    //

    //  Created by king on 16/11/2.

    //  Copyright © 2016年 king. All rights reserved.

    //

    #import "ViewController.h"

    @interface ViewController ()

    @end

    @implementation ViewController

    - (void)viewDidLoad {

        [super viewDidLoad];

        

        UIImageView *img = [[UIImageView alloc] initWithFrame:CGRectMake(25, 100, 150, 200)];

        

        [img setImage:[UIImage imageNamed:@"picture"]];

        

        [self.view addSubview:img];

        

        UIImageView *img1 = [[UIImageView alloc] initWithFrame:CGRectMake(200, 100, 150, 200)];

        

        [img1 setImage:[UIImage imageNamed:@"picture"]];

        

        [self.view addSubview:img1];

        

        UIVisualEffectView *visualEffectView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];

        [visualEffectView setFrame:CGRectMake(200, 100, 150, 200)];

        visualEffectView.alpha = 0.5;

        [self.view addSubview:visualEffectView];

        

    }

    - (void)didReceiveMemoryWarning {

        [super didReceiveMemoryWarning];

        // Dispose of any resources that can be recreated.

    }

    @end

     至于效果就是这个样子

  • 相关阅读:
    Classview配置与访问
    MongoDB(NoSQL) 非关系型数据库
    服务器出现500错误的时候,让PHP显示错误信息
    Linux_目录介绍
    各类ip地址范围和私有地址范围
    Raid_磁盘冗余阵列
    Python_文件操作_读
    Git操作命令
    记录关于校园网登录不了腾讯的软件得问题解决
    关于科研方面分享的一些经验
  • 原文地址:https://www.cnblogs.com/var-king/p/6023010.html
Copyright © 2011-2022 走看看