您的位置:首页 > 其它

设置圆角。边框 和 阴影

2015-06-03 16:25 281 查看
//设置圆角
self.appImgView.layer.masksToBounds = YES;
self.appImgView.layer.cornerRadius = 5;
//设置边框
self.appImgView.layer.borderColor = [[UIColor redColor] CGColor];
self.appImgView.layer.borderWidth = 1.0f;
//设置阴影
self.BgAPPImageView.layer.shadowColor = [UIColor blackColor].CGColor;//阴影颜色
self.BgAPPImageView.layer.shadowOffset = CGSizeMake(2, 2);//偏移距离
self.BgAPPImageView.layer.shadowOpacity = 1;//不透明度
self.BgAPPImageView.layer.shadowRadius = 2.0;//半径


但是设置了圆角就不能设置阴影  因为  设置阴影的话 
masksToBounds 就不能为YES
只能再写个底图
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: