下面是编程之家 jb51.cc 通过网络收集整理的代码片段。
编程之家小编现在分享给大家,也给大家做个参考。
#import "ViewController.h" #import "ILTranslucentView.h" #import <QuartzCore/QuartzCore.h> #import <CoreGraphics/CoreGraphics.h> @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view,typically from a nib. [scrollView setContentSize:CGSizeMake(self.view.frame.size.width,self.view.frame.size.height*2)]; // [self initWithILTranslucentView]; [self initWithVisualEffectView]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (void)initWithILTranslucentView { ILTranslucentView *translucentView = [[ILTranslucentView alloc] initWithFrame:CGRectMake(0.0,(self.view.frame.size.height - 100.0)/2,320,100.0)]; translucentView.translucentAlpha = 1.0; translucentView.translucentStyle = UIBarStyleDefault; translucentView.translucentTintColor = [UIColor clearColor]; translucentView.backgroundColor = [UIColor clearColor]; [self.view addSubview:translucentView]; } - (void)initWithVisualEffectView { UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0.0,30.0,self.view.frame.size.width,200.0)]; // [view setBackgroundColor:[UIColor whiteColor]]; // [view.layer setShadowOffset:CGSizeMake(-2.0,-2.0)]; // [view.layer setShadowPath:[[UIBezierPath bezierPathWithRect:CGRectMake(0.0,0.0,view.bounds.size.width + 4.0,view.bounds.size.height + 4.0)] CGPath]]; // [view.layer setShadowColor:[[UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:0.5] CGColor]]; // [view.layer setShadowOpacity:0.5]; [self.view addSubview:view]; UIVisualEffect *blurEffect; blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleExtraLight]; UIVisualEffectView *visualEffectView; visualEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect]; [visualEffectView setFrame:view.bounds]; [view addSubview:visualEffectView]; } @end
以上是编程之家(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。
如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。