zoukankan      html  css  js  c++  java
  • 实现毛玻璃效果

    #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
  • 相关阅读:
    expandafter
    又回到了kde
    朗读软件
    tex bookmarks
    vim命令执行时间
    vim,tex的编译
    utorrent
    火狐的扩展
    linux 无线指示灯闪
    tex溢出报警
  • 原文地址:https://www.cnblogs.com/521it/p/5146385.html
Copyright © 2011-2022 走看看