iOS开发笔记--Layer 图层圆角、边框 、底纹其他常用操作
简介:
<ol start="1" class="dp-objc" style="padding:0px; border:none; list-style-position:initial; color:rgb(92,92,92); font-family:Consolas,'Courier New',Courier,mono,serif; line-height:26px; margin:0px
- #import <QuartzCore/QuartzCore.h> // 添加系统框架
-
-
- layer.backgroundColor = [UIColor cyanColor].CGColor;
- layer.contents = (id)[UIImage imageNamed:@"view_BG.png"].CGImage;
- layer.cornerRadius = 8;
- layer.masksToBounds = YES;
- layer.borderWidth = 5;
- layer.borderColor = [UIColor colorWithRed:0.52 green:0.09 blue:0.07 alpha:1].CGColor;
- layer.shadowOffset = CGSizeMake(0, 3);
- layer.shadowRadius = 10.0;
- layer.shadowColor = [UIColor blackColor].CGColor;
- layer.shadowOpacity = 0.9;