博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
实现毛玻璃效果
阅读量:4493 次
发布时间:2019-06-08

本文共 776 字,大约阅读时间需要 2 分钟。

#import "ViewController.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad {    [super viewDidLoad];    // 1.1 创建UIImageView对象    UIImageView *imageView = [[UIImageView alloc] init];    // 1.2 设置imageView的frame    imageView.frame = self.view.bounds;    // 1.3 设置图片    imageView.image = [UIImage imageNamed:@"1"];    // 1.4 设置图片的内容模式    imageView.contentMode = UIViewContentModeScaleAspectFill;    // 1.5 设置毛玻璃    UIToolbar *toolBar = [[UIToolbar alloc] init];    toolBar.frame = imageView.bounds;    // 1.6 设置工具栏的样式    toolBar.barStyle = UIBarStyleBlack;    // 1.7 设置透明度    toolBar.alpha = 0.98;    [imageView addSubview:toolBar];    // 2.0 加入控制器的view中    [self.view addSubview:imageView];}@end

 

转载于:https://www.cnblogs.com/521it/p/5146385.html

你可能感兴趣的文章
centos下nodejs和ws安装
查看>>
js去除字符串的前后空白
查看>>
tornado源码分析(二): ioloop
查看>>
Spring Boot 入门之消息中间件篇(转发)
查看>>
python中input()和raw_input()的区别
查看>>
POJ 2485 Highways(最小生成树Prim算法)
查看>>
计算机模型
查看>>
python批量给云主机配置安全组
查看>>
Graph_Master(连通分量_G_Trajan+Thought)
查看>>
nginx反向代理substitutions4nginx模块实现替换字符盗站 nginx.conf配置
查看>>
Singleton单例模式
查看>>
10个CSS简写技巧让你永远受用
查看>>
Codeforces 476C Dreamoon and Sums (水
查看>>
Docker,Rkt谁会笑到最后
查看>>
文本界面听歌神器--moc
查看>>
Ubuntu上安装谷歌第二代机器学习系统TensorFlow
查看>>
JAVA设计模式之适配器模式
查看>>
CentOS安装Nginx 以及日志管理
查看>>
SEO总结(一)
查看>>
<HTML深入浅出> 读书笔记
查看>>