[英]How to remove border around UICollectionView in iOS?
I have made a UICollectionView
in my project.It is custom UICollectionViewCell
.When i run the app it shows the black border around the UICollectionViewCell
.Please tell me how can i remove that border around the custom cell?我在我的项目中创建了一个
UICollectionView
。它是自定义UICollectionViewCell
。当我运行应用程序时,它会显示UICollectionViewCell
周围的黑色边框。请告诉我如何删除自定义单元格周围的边框?
UICollectionViewCell *cell = [[UICollectionViewCell alloc] init];
cell.layer.borderColor = (__bridge CGColorRef _Nullable)([UIColor clearColor]);
cell is a name given to Collection View cell element. cell 是集合视图单元格元素的名称。 This line of code will make the border color transparent.
这行代码将使边框颜色透明。
Swift 5 version斯威夫特 5 版本
var cell = UICollectionViewCell()
cell.layer.borderColor = UIColor.clear.cgColor
Tested the code in Swift 5在 Swift 5 中测试代码
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.