原理图如下:【需要注意的是,灰度View与中间的小View是并列的关系,否则,带透明度的灰度图就会影响小View的透明度】

- (void)show{

UIWindow *win = [[UIApplication sharedApplication] keyWindow];

UIView *topView = [win.subviews objectAtIndex:0];

[topView addSubview:self];

[UIView animateWithDuration:0.1 animations:^{

[self layoutIfNeeded];

}];

}

- (void)hide{

[UIView animateWithDuration:0.1 animations:^{

self.alpha = 0;

[self layoutIfNeeded];

} completion:^(BOOL finished) {

[self removeFromSuperview];

}];

}

最新文章

  1. invalidate()和postInvalidate() 的区别及使用
  2. 自己封装的一个java图片验证码
  3. Velocity魔法堂系列三:模板与宿主环境通信
  4. P1179: [Apio2009]Atm
  5. manacher算法(转载)
  6. Object之克隆对象clone 和__clone()函数
  7. C# 6 与 .NET Core 1.0 高级编程 - 39 章 Windows 服务(上)
  8. Mysql update in报错 [Err] 1093 - You can't specify target table 'company_info' for update in FROM clause
  9. python中使用递归实现反转链表
  10. UTF-8 的BOM带来的麻烦
  11. Mybatis插件原理分析(三)分页插件
  12. Mysql数据存在更新,不存在则插入的实现
  13. [P4721] 分治 FFT
  14. Ubuntu下安装软件提示无法锁定管理目录(/var/lib/dpkg/)的解决办法
  15. [Algorithm] Deferred Acceptance Algorithm
  16. Xpath同时选取不同属性的元素
  17. 2018.09.10 bzoj1499: [NOI2005]瑰丽华尔兹(单调队列优化dp)
  18. redis介绍(6)集群(ruby)
  19. Scala(四):对象
  20. 7、包装类、System、Math、Arrays、大数据运算

热门文章

  1. css3 flex流动自适应响应式布局样式类
  2. 移动互联网终端的touch事件,touchstart, touchend, touchmove
  3. BZOJ4408: [Fj Winter Camp 2016]神秘数
  4. COJ976 WZJ的数据结构(负二十四)
  5. 配置当前用户使用豆瓣pip源
  6. CMYK印刷色
  7. JavaScript_解决safari浏览器window.open无法实现的问题
  8. Spring框架中的定时器 如何使用和配置
  9. Beetl2.2使用说明书20151201
  10. PHP+jQuery 注册模块的改进之三:使用 Smarty3