UITableViewCell Separator disappearing in iOS7
I dumped the subview hierarchy of affected cells and found that the _UITableViewCellSeparatorView
was set to hidden. No wonder it's not shown!
I overrode layoutSubviews
in my UITableViewCell
subclass and now the separators are displayed reliably:
Objective-C:
- (void)layoutSubviews {
[super layoutSubviews];
for (UIView *subview in self.contentView.superview.subviews) {
if ([NSStringFromClass(subview.class) hasSuffix:@"SeparatorView"]) {
subview.hidden = NO;
}
}
}
Swift:
override func layoutSubviews() {
super.layoutSubviews()
guard let superview = contentView.superview else {
return
}
for subview in superview.subviews {
if String(subview.dynamicType).hasSuffix("SeparatorView") {
subview.hidden = false
}
}
}
The other solutions proposed here didn't work consistently for me or seem clunky (adding custom 1 px footer views).
UITableViewCell Separator disappearing in iOS15
In you viewDidLoad
function add this:
yourTableViewReference.fillerRowHeight = UITableViewCellSeparatorStyleSingleLine
UITableView cell's seperators disappear when selected
The cause of my issue was the fact I used a blue color shade to show a cell being selected. This shade however was a little too big. It was covering the seperator
Why my UITableView separators are missing when using custom cell?]
- Check your cells height ,maybe it bigger than the height you set on the delegate method or on the storyboard!
- Make them same you could see the separators
UITableViewCell separator not showing up
Is the UITableViewCell in IB associated with a UITableViewCell subclass that overrides drawRect:
? If so, make sure you are calling the super implementation, as that's what draws the line at the bottom. If you are overriding layoutSubviews
make sure no views are obscuring the bottom of the cell.
Related Topics
How to Use Git Properly with Xcode
How to Manage Sessions with Afnetworking
Checking Location Service Permission on iOS
How to Build .Ipa for React Native
Allow Unverified Ssl Certificates in Wkwebview
How to Detect the Colour of an iPhone 5C
What Does Warning "Mapping Architecture Arm64 to X86_64" Mean
Objective C - Pass by Value and Pass by Reference
Code Sign Error on Xcode 8 and iOS 10 Cordova Project
Scale Text Label by Screen Size
How to Control Shadow Spread and Blur
Uiimageview Aspect Fit and Center
How to Set a Custom View's Intrinsic Content Size in Swift
Logging Method Signature Using Swift
Invalid Update: Invalid Number of Items on Uicollectionview
Number of Threads Created by Gcd