一:如OC一样,swift中cell的分割线也是默认缺了左边一点,那么如何让分割线左对齐呢
1.那么我们在自定义cell的基类中设置下,那么以后的cell都继承基类,以后都不会有分割线问题了
import UIKit
class SCYBaseTableViewCell: UITableViewCell {
override func awakeFromNib() {
super.awakeFromNib()
initCell()
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder aDecoder:NSCoder) {
super.init(coder: aDecoder)
}
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
initCell()
}
private func initCell(){
self.selectionStyle