如何把图片UIImageView某个区域变成透明
2015-06-03 15:31
375 查看
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 64, SIZE.width, SIZE.height)];
// imageView.alpha = 0.8;
[imageView setBackgroundColor:[UIColor grayColor]];
// imageView.alpha = 0.8;
[imageView setBackgroundColor:[UIColor grayColor]];
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRect:imageView.bounds]; UIBezierPath *holePath = [UIBezierPath bezierPathWithRect:CGRectInset(CGRectMake(50, 100, SIZE.width-100, SIZE.width-100), 0, 0)];// [maskPath appendPath:holePath]; CAShapeLayer *mask = [CAShapeLayer layer]; [mask setFillRule:kCAFillRuleEvenOdd]; mask.path = maskPath.CGPath; [imageView.layer setMask:mask]; [self.view addSubview:imageView];
相关文章推荐
- java、C++-带标签的break 和 continue语句
- UITableView 横向滚动(二)
- DRUID连接池的使用
- ueditor富文本
- ios UIImage修改大小后图片模糊解决办法
- iOS 全局修改UINavigation 后退按钮
- 动态修改UINavigationBar的背景色
- IOS UIFont 字体大全
- android UI 操作 不要在子线程中操作UI
- IOS自定义UIAlertView样式,实现可替换背景和按钮
- UIALertView的基本用法与UIAlertViewDelegate对对话框的事件处理方法
- Druid数据库连接池使用
- poj2299 Ultra-QuickSort
- heratbeat V2版配置LAMP HA说明及hb_gui工具使用说明
- 3个UIimageView实现图片的循环切换
- expdp query及parfile的使用
- MySql提示:The server quit without updating PID file(…)失败
- iOS学习(6)——UIAlertView
- 贪心+stack Codeforces Beta Round #5 C. Longest Regular Bracket Sequence
- Java中的break和continue关键字使用总结