- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.yuanjiao.backgroundColor = [UIColor blackColor];
self.yuanjiao.layer.cornerRadius = self.yuanjiao.frame.size.width/2;
self.yuanjiao.layer.masksToBounds = YES;
self.yuanjiao.layer.borderWidth = 5;
self.yuanjiao.layer.borderColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:1].CGColor;
// self.yuanjiao.layer.shadowOffset = CGSizeMake(0, 0);
// self.yuanjiao.layer.shadowRadius = 0.0;
// self.yuanjiao.layer.shadowColor = [UIColor whiteColor].CGColor;
// self.yuanjiao.layer.shadowOpacity = 0.0;
}
效果:
边框没有完全覆盖背景。
设置shadowxxx无效。
答案 0 :(得分:2)
这是图层属性的预期行为。如果您查看borderWidth
borderWidth
属性,您会发现: -
<强>讨论强>
当此值大于0.0时,图层使用当前borderColor值绘制边框。边界通过此属性中指定的值从接收器的边界插入。 它在接收者的内容和子图层上方合成,并包含cornerRadius属性的效果。此属性的默认值为0.0。
如果您需要使用blackColor
填充blackColor
部分,那么您有两个选择
borderColor
填充的小圆圈。blackColor
属性分配给select null num into #a
union all
select null
union all
select null
union all
select null
union all
select null
union all
select null
union all
select null
select * into #b from
(select rn = row_number()over (order by (select null)) from sys.objects A cross join sys.objects B) A
where rn <=10
select #b.rn as numbers from #a cross join #b
order by 1
。