设置UIView阴影shadow 边框 边框颜色
2014-04-20 22:44
441 查看
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor=[UIColor whiteColor];
UIView * viewTest=[[UIView alloc] initWithFrame:CGRectMake(50, 50, 200, 200)];
viewTest.backgroundColor=[UIColor lightGrayColor];
//UIView设置阴影
[[viewTest layer] setShadowOffset:CGSizeMake(1, 1)];
[[viewTest layer] setShadowRadius:5];
[[viewTest layer] setShadowOpacity:1];
[[viewTest layer] setShadowColor:[UIColor blackColor].CGColor];
//UIView设置边框
[[viewTest layer] setCornerRadius:5];
[[viewTest layer] setBorderWidth:2];
[[viewTest layer] setBorderColor:[UIColor whiteColor].CGColor];
[self.view addSubview:viewTest];
}
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor=[UIColor whiteColor];
UIView * viewTest=[[UIView alloc] initWithFrame:CGRectMake(50, 50, 200, 200)];
viewTest.backgroundColor=[UIColor lightGrayColor];
//UIView设置阴影
[[viewTest layer] setShadowOffset:CGSizeMake(1, 1)];
[[viewTest layer] setShadowRadius:5];
[[viewTest layer] setShadowOpacity:1];
[[viewTest layer] setShadowColor:[UIColor blackColor].CGColor];
//UIView设置边框
[[viewTest layer] setCornerRadius:5];
[[viewTest layer] setBorderWidth:2];
[[viewTest layer] setBorderColor:[UIColor whiteColor].CGColor];
[self.view addSubview:viewTest];
}
相关文章推荐
- 设置UIView阴影shadow 边框 边框颜色
- 设置UIView阴影shadow 边框 边框颜色
- 设置UIView阴影shadow 边框 边框颜色
- UIView设置圆角、边框和阴影
- iPhone之为UIView设置阴影(CALayer的shadowColor,shadowOffset,shadowOpacity,shadowRadius,shadowPath属性)
- IOS--UIViewUIButtonUIImageView设置圆角、阴影、边框的方法
- UIView,UIButton,UIImageView等设置圆角,设置阴影,设置边框的方法
- UIView设置圆角、边框和阴影
- iPhone开发:给UIView设置边框和阴影
- iPhone之为UIView设置阴影(CALayer的shadowColor,shadowOffset,shadowOpacity,shadowRadius,shadowPath属性)
- HTML5_CSS入门(尺寸大小、颜色单位、溢出、哪些元素可以设置尺寸、边框,边框倒角、边框阴影,轮廓)
- ios学习--layer的应用(设置UIView子类边框属性&字体阴影属性)
- IOS--UIViewUIButtonUIImageView设置圆角、阴影、边框的方法
- UIView,UIButton,UIImageView等设置圆角,设置阴影,设置边框的方法
- ios UIView 和 UIButton边框和阴影设置
- UIView,UIButton,UIImageView等设置圆角,设置阴影,设置边框的方法
- [Object-C]关于 UiView添加边框和设置边框的颜色
- iOS开发之设置UIView边框颜色及边线厚度以及圆角及弧度
- UIView 设置边框颜色 和 UILabel 的设置
- UIView设置圆角、边框和阴影