Although there a few answers already on this topic. None of them cover Swift 3 and they are from a long time ago. What is currently the best way to change the separator height in a UITableView in Swift 3?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- SwiftUI: UIImage (QRCode) does not load after call
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Using if let syntax in switch statement
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Enum with associated value conforming to CaseItera
- Swift - hide pickerView after value selected
- Is there a Github markdown language identifier for
Try this Swift 3:
Updated for Swift 3:
If you want to change the height of the UITableView separator, use the code below.
You should add it to the UITableViewCell method
awakeFromNib()
to avoid re-creation.For Those who want to do it using autolayout here is the code
This is a correct way to do this.
First, in your ViewController you should set (tableView.separatorStyle = .none)
Second, in your TableViewCell class your should create a separatorView. And don't forget to inherit TableViewCell class for your cell.
Finally, you've got a thin separator line and, of course, you can increase this value what do you like.