本文主要是介绍UI10_UIImageView,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1.UIImageView
- (void)viewDidLoad {UIImage *image = [UIImage imageNamed:@"1.jpg"];UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(100, 100, 200, 200)];// 给imageView设置图片.imageView.image = image;[self.view addSubview:imageView];imageView.layer.cornerRadius = 100;imageView.layer.borderWidth = 1;imageView.layer.masksToBounds = YES;2.毛玻璃效果.UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];UIVisualEffectView *effectView = [[UIVisualEffectView alloc] initWithEffect:effect];effectView.frame = CGRectMake(0, 0, imageView.frame.size.width, imageView.frame.size.height);effectView.alpha = 0.5;3.添加子视图.[imageView addSubview:effectView];
}
这篇关于UI10_UIImageView的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!