当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - How to hide the seperator at the top of the first cell?

问题描述:

I'm customizing a Tableview ..

I want to hide the top seperator line separating on the first cell. Any ideas how to do this?

网友答案:

Configure TableView with no Separators, and then add custom image at the bottom of every cell which will look same as separator, so you can achieve this functionality.

网友答案:

UITableView has

@property(nonatomic) UITableViewCellSeparatorStyle separatorStyle;
@property(nonatomic,retain) UIColor               *separatorColor; 

So try this

tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

or

tableView.separatorColor = [UIColor clearColor];

And after that you should customize all of your cells with your own separators. Simply add view with autoresizing mask flexible top margin and flexible width Don't forget to add it to cell.contentView Actual color of separator is [UIColor grayColor];

分享给朋友:
您可能感兴趣的文章:
随机阅读: