简体   繁体   中英

How to remove UITableView separator (Xcode)

In a prior Xcode versions, settings the separator style to none for the UITableView via the interface builder used to solve the problem.

在此处输入图片说明

But, this is no longer works in Xcode 7. How to remove/hide the UITableView Seperator in Xcode 7?

Xcode 7 is no longer picking the separator style from the interface builder. This may also be related to the iOS 9 SDK as the Base SDK.

But, it always can be achieved programmatically:

// objective-c
[tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];

// swift
tableview.separatorStyle = .None

Related, this is also applied on the UITableView background color:

// objective-c
[tableView setBackgroundColor:[UIColor clearColor]];

// swift
tableView.backgroundColor = .clear

In table init (viewDidLoad) you can adding this line:

self.tableView.separatorColor = [UIColor clearColor];
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM