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

     至于效果就是这个样子

  • 相关阅读:
    9多线程与异步
    5文件操作
    3C#面向对象概念
    2初步了解C#类与对象
    7Linq查询语言
    6字符编码
    8网络请求之http
    1初步了解C#语言基础
    4C#格式处理
    WPF及Silverlight中将DataGrid数据导出 南京酷得软件
  • 原文地址:https://www.cnblogs.com/var-king/p/6023010.html
Copyright © 2011-2022 走看看