声明全局变量

#define kMainBoundsHeight   ([UIScreen mainScreen].bounds).size.height //屏幕的高度
#define kMainBoundsWidth    ([UIScreen mainScreen].bounds).size.width //屏幕的宽度
const CGFloat animalDuration  = 0.25;   //添加动画延时效果

ViewController.m

//
//  ViewController.m
//  iPhone
//
//  Created by zlw on 2018/4/10.
//  Copyright © 2018年 xujinzhong. All rights reserved.
//

#import "ViewController.h"
#import "Masonry.h"
#import "ReactiveObjC.h"
#import "showV.h"@interface ViewController ()@end@implementation ViewController
{UIButton *_doneBtn;
}- (void)viewDidLoad {[super viewDidLoad];// Do any additional setup after loading the view, typically from a nib.self.view.backgroundColor = [UIColor whiteColor];_doneBtn = [[UIButton alloc] init];_doneBtn.backgroundColor = [UIColor grayColor];_doneBtn.layer.cornerRadius = 4;_doneBtn.layer.masksToBounds = YES;[_doneBtn setTitle:@"show" forState:UIControlStateNormal];[self.view addSubview:_doneBtn];[_doneBtn mas_makeConstraints:^(MASConstraintMaker *make) {make.top.offset(100);make.centerX.equalTo(self.view);make.width.offset(80);make.height.offset(100);}];__block showV *_showView;[[_doneBtn rac_signalForControlEvents:UIControlEventTouchDown]subscribeNext:^(__kindof UIControl * _Nullable x) {_showView = [[showV alloc] init];[self.view addSubview:_showView];_showView.frame = CGRectMake(0, 0, kMainBoundsWidth, kMainBoundsHeight);[_showView showViewData];}];
}@end

showV.h

//
//  showV.h
//  iPhone
//
//  Created by zlw on 2018/4/10.
//  Copyright © 2018年 xujinzhong. All rights reserved.
//

#import <UIKit/UIKit.h>@interface showV : UIView-(void)showViewData;@end

showV.m

//
//  showV.m
//  iPhone
//
//  Created by zlw on 2018/4/10.
//  Copyright © 2018年 xujinzhong. All rights reserved.
//

#import "showV.h"
#import "Masonry.h"
#import "ReactiveObjC.h"@interface showV ()@property(nonatomic, strong) UIView *bkView;
@property(nonatomic, strong) UIVisualEffectView *alphView;
@property(nonatomic, strong) NSString *content;@end@implementation showV-(instancetype)init{self = [super init];if (self) {self.backgroundColor = [UIColor whiteColor];}return self;
}-(NSString *)content{if (!_content) {_content = @"您将要激活闪电下单模式。通过点击下面的“我接受这些合同条款”,您会承认您已经阅读并理解以下合同条款,您同意特此遵守。您当前的程序端版本使您在下面的订单提交模式间选择。您同意遵守本规定的条款和条件,有关这样的模式。\n\n1. 订单提交的默认模式是两步处理法。使用默认模式,您需先选择买卖方向,然后您需要选择一个合适的订单类型,它的参数并且根据您选定的具体订单类型和您的交易意愿,通过点击买入,卖出,下单,确认您订单的提交。使用默认模式,您的订单将直到您完成前面提到的两个步骤才会提交。\n\n2. 订单提交的闪电下单模式是一步处理法。使用闪电下单模式,您的订单将会被直接提交,而无需再次确认。不会有后续确认提示您点击。一旦您点击,您将无法撤销或更改您的订单。在正常市场条件和系统性能下,市价订单提交后,单子会立即成交。\n\n您可以在【开启闪电下单按钮】停用闪电下单模式。\n\n通过选择闪电下单模式,您了解到您的订单将根据您点击卖或买价进行提交,没有后续订单确认。您同意并接受您选择的订单提交模式相关的全部风险,包括,但不限于,过失风险,提交订单时发生的失误。\n\n您同意完全赔偿和使ZLW TRADING 在由您,您的交易经理或任何代表您进行交易的人,造成的任何错误遗漏或失误而导致的结果引起的各种损失,成本和费用上免受损失。\n";}return _content;
}-(void)showViewData{UIColor *bkColor = [UIColor blackColor];UIColor *whileColor = [UIColor whiteColor];UIColor *grayColor = [UIColor grayColor];UIBlurEffect *beffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];_alphView = [[UIVisualEffectView alloc] initWithEffect:beffect];[self addSubview:_alphView];_alphView.alpha = 0;[_alphView mas_makeConstraints:^(MASConstraintMaker *make) {make.edges.equalTo(self);}];self.bkView = [[UIView alloc] init];[self addSubview:self.bkView];self.bkView.backgroundColor = bkColor;self.bkView.frame = CGRectMake(0, kMainBoundsHeight-100, kMainBoundsWidth, 500);UILabel *labTitle = [UILabel new];labTitle.text = @"免责声明";labTitle.textAlignment = NSTextAlignmentCenter;labTitle.backgroundColor = bkColor;labTitle.textColor = whileColor;[self.bkView addSubview:labTitle];[labTitle mas_makeConstraints:^(MASConstraintMaker *make) {make.left.top.equalTo(self.bkView);make.width.equalTo(self.bkView);make.height.offset(50);}];UITextView *textV = [UITextView new];textV.backgroundColor = bkColor;textV.textColor = grayColor;textV.font = [UIFont systemFontOfSize:14];textV.text = self.content;textV.editable = NO;[self.bkView addSubview:textV];[textV mas_makeConstraints:^(MASConstraintMaker *make) {make.top.equalTo(labTitle.mas_bottom);make.centerX.equalTo(self.bkView);make.width.equalTo(self.bkView).offset(-20);make.bottom.equalTo(self.bkView).offset(-50);}];UIButton *closeBtn = [UIButton new];[closeBtn setTitle:@"关闭" forState:UIControlStateNormal];closeBtn.backgroundColor = [UIColor blueColor];[self.bkView addSubview:closeBtn];[closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {make.top.equalTo(textV.mas_bottom);make.centerX.equalTo(textV);make.width.equalTo(self.bkView);make.bottom.equalTo(self.bkView);}];[[closeBtn rac_signalForControlEvents:UIControlEventTouchDown] subscribeNext:^(__kindof UIControl * _Nullable x) {[UIView animateWithDuration:animalDuration animations:^{self.alphView.alpha = 0.0;self.bkView.frame = CGRectMake(0, kMainBoundsHeight, kMainBoundsWidth, 500);} completion:^(BOOL finished) {[self removeFromSuperview];}];}];[UIView animateWithDuration:animalDuration animations:^{self.alphView.alpha = 1.0;self.bkView.frame = CGRectMake(0, kMainBoundsHeight-505, kMainBoundsWidth, 500);}];
}- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{[UIView animateWithDuration:animalDuration animations:^{self.alphView.alpha = 0.0;self.bkView.frame = CGRectMake(0, kMainBoundsHeight, kMainBoundsWidth, 500);} completion:^(BOOL finished) {[self removeFromSuperview];}];}@end

转载于:https://www.cnblogs.com/xujinzhong/p/8793436.html

iOS - 毛玻璃动画效果相关推荐

  1. iOS 转盘动画效果实现

    代码地址如下: http://www.demodashi.com/demo/11598.html 近期公司项目告一段落,闲来无事,看到山东中国移动客户端有个转盘动画挺酷的.于是试着实现一下,看似简单, ...

  2. ios animation 动画效果实现

    1.过渡动画 CATransition CATransition *animation = [CATransition animation];[animation setDuration:1.0];[ ...

  3. Android 文件夹放大缩小仿IOS融合动画效果

    效果如下,打开文件夹时从小到大与最终位置大小吻合,关闭文件夹时缩小到图标原有位置做到无缝融合效果. 过程分析 (一)文件展开后的布局 如上图文件夹打开后布局层次 1.最下面时背景层(背景不移动但有透明 ...

  4. iOS 简单动画效果

    1.最简单,最实用,最常用的[移动动画] //移动一个view -------------------------------------------------------------------- ...

  5. iOS火焰动画效果、图文混排框架、StackView效果、偏好设置、底部手势等源码

    iOS精选源码 高性能图文混排框架,构架顺滑的iOS应用. 使用OpenGLE覆盖阿尔法通道视频动画播放器视图. 可选最大日期截至当日日期的日期轮选器ChooseDatePicker 简单轻量的图片浏 ...

  6. 简单的UIButton按钮动画效果iOS源码

    这个是简单的UIButton按钮动画效果案例,源码,简单的UIButton按钮动画,可以自定义button属性. 效果图: <ignore_js_op> 使用方法: 使用时把ButtonA ...

  7. iOS 毛玻璃效果的实现方法

    iOS开发中有的时候需要将图片设置模糊,来实现特定的效果获取更好的用户体验, iOS7之后半透明模糊效果得到大范围使用的比较大,现在也可以看到很多应用局部用到了图片模糊效果,可以通过高斯模糊和毛玻璃效 ...

  8. iOS开发 QQ粘性动画效果

    QQ(iOS)客户端的粘性动画效果 时间 2016-02-17 16:50:00  博客园精华区 原文  http://www.cnblogs.com/ziyi--caolu/p/5195615.ht ...

  9. iOS实现“下雨下雪”动画效果和“烟花”动画效果

    "下雨"的动画效果 一.效果展示 二.实现流程 设置背景 func setupUI() {self.imageView = UIImageView.init()self.image ...

最新文章

  1. android 高级画布绘图
  2. ajax省市联动案例,AJAX案例四:省市联动(示例代码)
  3. airflow sql_alchemy_conn mysql_搭建AirFlow—— 一段波折后的总结
  4. scrapy爬取京东
  5. SpringSecurity过滤器链加载原理
  6. 科技前沿及论文写作相关视频
  7. SqlBulkCopy批量插入数据库
  8. UIButton、UIImageView、UILabel的选择
  9. 谁将掌控中国的金融?(上)
  10. Windows 之间用rsync同步数据(cwRsyncServer配置)
  11. iOS学习01C语言数据类型
  12. 罗技 GHUB驱动的官方下载网址
  13. oracle数据模型三要素,关系模型三要素
  14. 单片机流水灯C语言实验报告,单片机LED灯实验报告.doc
  15. java ape格式转换_ape格式怎么转换mp3?ape转换mp3的正确方法
  16. RINEX3文件中的toc,toe,IODE
  17. Python笔记_39_前端_HTML
  18. 【转自人人】本科生如何发表论文
  19. win10浏览器加载很慢_Win10 IE浏览器的网页加载速度很慢总是卡死怎么办
  20. Windows XP 批處理中For命令用法

热门文章

  1. verilog中数组的定义_开源仿真工具Icarus Verilog中的verilog parser
  2. ptpd和ptp4l 软件核心算法
  3. android 调用java类_Android中在WebView里实现Javascript调用Java类的方法
  4. matlab整定串级pid,PID算法在Matlab串级控制中的应用
  5. 如何正确使用as follows 与 following
  6. 【SRIO】5、Xilinx RapidIO核例子工程源码分析
  7. 【FPGA】SRIO IP核系统总览以及端口介绍(三)(Messaging Port、User-Defined Port介绍)
  8. Exchange/Office365 自动处理脚本:环境准备篇(一)
  9. 第一次来写博客,这里可以记录很多故事。
  10. 分享一个MD5加密的工具类