iOS 实际项目出现的问题

ios 毛玻璃效果

2018-02-01  本文已影响18人  江河_ios

- (void)viewDidLoad {

    [super viewDidLoad];

    // Do any additional setup after loading the view.

    self.view.backgroundColor=[UIColor whiteColor];

    [self.view addSubview:self.imageView];

    [self.view addSubview:self.effctView];

}

-(UIImageView *)imageView

{

    if (!_imageView ) {

        _imageView=[[UIImageView alloc]initWithFrame:self.view.bounds];

        _imageView.image=[UIImage imageNamed:@"1"];

    }

    return _imageView;

}

-(UIVisualEffectView *)effctView

{

    if (!_effctView) {

        _effctView=[[UIVisualEffectView alloc]initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];

        _effctView.frame=CGRectMake(0, 0, YHScreenWith, YHScreenHeight/2);

        _effctView.alpha=0.4;

    }

    return _effctView;

}

效果图
上一篇 下一篇

猜你喜欢

热点阅读