Reputation: 243
I have attached an image of cells in a table view, and you can notice the 2 separator lines in the middle are a tiny bit thicker/darker than the 2 outer lines. I want the lines to all be consistent, and the color/thickness of the outer two lines. I could not find a solution, so I am wondering if anyone knows of any. I figure it would be a simple solution, but I haven't been able to figure it out. Thanks guys.
Upvotes: 2
Views: 4895
Reputation: 3811
Hope this helps you.
Create a custom separator Line Programatically:
UIView *separatorLine = [[UIView alloc] initWithFrame:
CGRectMake(0, cell.contentView.frame.size.height - 1.0,
cell.contentView.frame.size.width, 1)];
separatorLine.backgroundColor = [UIColor blackColor];;
[cell.contentView addSubview: separatorLine];
or you can add a image view for separator in custom UITableviewCell in UI
Upvotes: 4
Reputation: 11127
Select your UITableView
from xib or storyboard, then make the UITableView
separator to None
.
See the image
Then place a UILabel
with the width same as of UITableViewCell
and height=1 in the bottom of your cell, clear the text of the label and set the backGround
color as per your wish, this will solve your problem.
Upvotes: 4