Ale*_*nat 5 cell shadow uitableview calayer ios
一切都在标题中。
我有一个带有单元格的 UITableView。该单元有一个阴影(self.layer.shadow ...)。
的问题是,所述阴影的一个单元被重叠的单元之上。我怎样才能防止这种行为?
这是我单元格中的代码:
self.layer.shadowColor = UIColor.gray.cgColor
self.layer.shadowOffset = .zero
self.layer.shadowOpacity = 0.15
self.layer.shadowRadius = 10
self.layer.cornerRadius = 8
backgroundColor = .white
Run Code Online (Sandbox Code Playgroud)
使用此代码添加阴影:-
self.layer.masksToBounds = false
self.layer.shadowOffset = CGSize(width: -1, height: 1)
self.layer.shadowOpacity = 0.2
self.layer.cornerRadius = 8
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1093 次 |
| 最近记录: |