0
iOS Swiftのすべてのセクション(セルのグループ)の周囲に影を設定したい。
iOS Swift 4のUITableViewのセクション周辺にドロップシャドウを設定するにはどうすればよいですか?
iOS Swiftのすべてのセクション(セルのグループ)の周囲に影を設定したい。
iOS Swift 4のUITableViewのセクション周辺にドロップシャドウを設定するにはどうすればよいですか?
スウィフト4
あなたは影のために、このコードと丸みを帯びた角を使用して、あなたの完璧なビューを得るまでの値を調整することができます:
override func tableView(_ tableView: UICollectionView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath)
cell.layer.cornerRadius = 10
let shadowPath2 = UIBezierPath(rect: cell.bounds)
cell.layer.masksToBounds = false
cell.layer.shadowColor = UIColor.black.cgColor
cell.layer.shadowOffset = CGSize(width: CGFloat(1.0), height: CGFloat(3.0))
cell.layer.shadowOpacity = 0.5
cell.layer.shadowPath = shadowPath2.cgPath
return cell
}
・ホープ、このことができます。このよう :)
このリンクをチェックしてくださいhttps://github.com/schluete/GroupedTableViewWithShadows –