ios8新特性之毛玻璃效果

mac2022-06-30  23

直接上代码

UIView *myView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; myView.backgroundColor = [UIColor redColor]; [self.view addSubview:myView]; //承载毛玻璃的底面 UIBlurEffect *blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; //毛玻璃效果 UIVisualEffectView *effectView = [[UIVisualEffectView alloc] initWithEffect:blur]; effectView.frame = CGRectMake(0, 0, 300, self.view.frame.size.height); [myView addSubview:effectView];

  怎么样? 是不是比较简单呢 ?

转载于:https://www.cnblogs.com/JJFly/p/4297327.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)