我在CollectionView当中把每个cell都通过cornerRadius的方式设为了圆形。
cell.imageView.layer.cornerRadius = 20;
cell.imageView.layer.maskToBounds = YES;
就是加了maskToBounds的时候会卡,但是不加又没有圆角的效果
求大神指教啊
我在CollectionView当中把每个cell都通过cornerRadius的方式设为了圆形。
cell.imageView.layer.cornerRadius = 20;
cell.imageView.layer.maskToBounds = YES;
就是加了maskToBounds的时候会卡,但是不加又没有圆角的效果
求大神指教啊
卡得厉害的话,你只能做一张跟 imageView
一样大小的黑白图了,中间是白的,圆角矩形,剩下的是黑的,将这个图做为 layer.mask
。
用了 mask 就不要 cornerRadius = 20
了
2 回答728 阅读
1 回答902 阅读
2 回答692 阅读
1 回答699 阅读
1 回答772 阅读
685 阅读
1 回答348 阅读
cell.imageView.clipsToBounds = YES;试试