lme
lme

Reputation: 79

iOS:I set my static tableView separator to none, can I set my separator in my cell all alone?

I set my static tableView's separator to none, can I set my separator in my cell all alone?

In the storyboar I set separator to none In the storyboar I set <code>separator</code> to <code>none</code>

This is the result of set separator to none, How can I add line under the cell? This is the result of set <code>separator</code> to <code>none</code>, How can I add line under the cell?

If I set separator to Single Line, there is double line above the red button If I set separator to <code>Single Line</code>, there is double line above the red button

Upvotes: 0

Views: 104

Answers (1)

Tony
Tony

Reputation: 542

You can set separator to none.Then draw a line in the cell which need a line.

UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(0, cellHeight - 1 / [UIScreen mainScreen].scale, [UIScreen mainScreen].bounds.size.width, 1 / [UIScreen mainScreen].scale)];
// (1 / [UIScreen mainScreen].scale) : 1px width line.
lineView.backgroundColor = [UIColor blackColor];
[self addSubview:lineView];

Upvotes: 1

Related Questions