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

     至于效果就是这个样子

  • 相关阅读:
    python+selenium 定位隐藏元素
    数据库的几种去重方法总结
    用例设计方法与测试实践相结合思路
    边界值分析法
    等价类分析法
    CYQ.Data 支持分布式数据库(主从备)高可用及负载调试
    linux下rpm包安装、配置和卸载mysq
    linux命令 rpm
    Linux命令之rpm
    Linux rpm命令详解
  • 原文地址:https://www.cnblogs.com/var-king/p/6023010.html
Copyright © 2011-2022 走看看