JCTableViewCell.swift 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // JCTableViewCell.swift
  3. // JChat
  4. //
  5. // Created by deng on 2017/4/6.
  6. // Copyright © 2017年 HXHG. All rights reserved.
  7. //
  8. import UIKit
  9. class JCTableViewCell: UITableViewCell {
  10. override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
  11. super.init(style: style, reuseIdentifier: reuseIdentifier)
  12. _init()
  13. }
  14. required init?(coder aDecoder: NSCoder) {
  15. super.init(coder: aDecoder)
  16. _init()
  17. }
  18. override func awakeFromNib() {
  19. super.awakeFromNib()
  20. _init()
  21. }
  22. private lazy var line: UILabel = UILabel()
  23. private func _init() {
  24. line.backgroundColor = UIColor(netHex: 0xE8E8E8)
  25. line.layer.backgroundColor = UIColor(netHex: 0xE8E8E8).cgColor
  26. addSubview(line)
  27. addConstraint(_JCLayoutConstraintMake(line, .bottom, .equal, contentView, .bottom))
  28. addConstraint(_JCLayoutConstraintMake(line, .left, .equal, self, .left, 15))
  29. addConstraint(_JCLayoutConstraintMake(line, .right, .equal, self, .right, -15))
  30. addConstraint(_JCLayoutConstraintMake(line, .height, .equal, nil, .notAnAttribute, 0.5))
  31. }
  32. }