关于带透明度的灰度层的show、hide
2024-10-12 02:25:17
原理图如下:【需要注意的是,灰度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];
}];
}
最新文章
- invalidate()和postInvalidate() 的区别及使用
- 自己封装的一个java图片验证码
- Velocity魔法堂系列三:模板与宿主环境通信
- P1179: [Apio2009]Atm
- manacher算法(转载)
- Object之克隆对象clone 和__clone()函数
- C# 6 与 .NET Core 1.0 高级编程 - 39 章 Windows 服务(上)
- Mysql update in报错 [Err] 1093 - You can't specify target table 'company_info' for update in FROM clause
- python中使用递归实现反转链表
- UTF-8 的BOM带来的麻烦
- Mybatis插件原理分析(三)分页插件
- Mysql数据存在更新,不存在则插入的实现
- [P4721] 分治 FFT
- Ubuntu下安装软件提示无法锁定管理目录(/var/lib/dpkg/)的解决办法
- [Algorithm] Deferred Acceptance Algorithm
- Xpath同时选取不同属性的元素
- 2018.09.10 bzoj1499: [NOI2005]瑰丽华尔兹(单调队列优化dp)
- redis介绍(6)集群(ruby)
- Scala(四):对象
- 7、包装类、System、Math、Arrays、大数据运算
热门文章
- css3 flex流动自适应响应式布局样式类
- 移动互联网终端的touch事件,touchstart, touchend, touchmove
- BZOJ4408: [Fj Winter Camp 2016]神秘数
- COJ976 WZJ的数据结构(负二十四)
- 配置当前用户使用豆瓣pip源
- CMYK印刷色
- JavaScript_解决safari浏览器window.open无法实现的问题
- Spring框架中的定时器 如何使用和配置
- Beetl2.2使用说明书20151201
- PHP+jQuery 注册模块的改进之三:使用 Smarty3