thisが必要ですが、first cell is having no shadow but the second cell gets such shadowにはテーブルビューセルのシャドウが表示されません。 私は、セルののViewControllerとテーブルビューセルのコンテンツビューを接続し、これをしたしている:テーブルビューセルシャドウが来ない
import UIKit
class staydetailsTableViewCell: UITableViewCell {
@IBOutlet weak var price: UILabel!
@IBOutlet weak var Content: UIView!
@IBOutlet weak var image1: UIImageView!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
Content.layer.masksToBounds = false
Content.layer.cornerRadius = 5
Content.layer.shadowColor = UIColor.red.cgColor
Content.layer.shadowOffset = CGSize(width: 0, height: 20)
Content.layer.shadowRadius = 20
Content.layer.opacity = 1
Content.layer.borderColor = UIColor.lightGray.cgColor
Content.layer.borderWidth = 1//(except for this nothing else is woking)
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
が付属していますContent'がtableViewCellのコンテンツビューに追加し 'ますか?それは合理的なフレームを持っていますか? – jefflovejapan
はいコンテンツはテーブルビューのセルのビューです@jefflovejapan –