在之前的Xcode版本中,通过用于解决问题的界面构建器,为UITableView
设置分隔符样式为无。
但是,这在Xcode 7中不再有效。如何删除/隐藏Xcode 7中的UITableView
分隔符?
答案 0 :(得分:8)
Xcode 7不再从界面中选择分隔符样式 建设者。这也可能与作为Base SDK的iOS 9 SDK有关。
但是,它始终可以通过编程方式实现:
// objective-c
[tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
// swift
tableview.separatorStyle = .None
相关,这也适用于UITableView背景颜色:
// objective-c
[tableView setBackgroundColor:[UIColor clearColor]];
// swift
tableView.backgroundColor = .clear
答案 1 :(得分:0)
在表init(viewDidLoad)中,您可以添加以下行:
self.tableView.separatorColor = [UIColor clearColor];
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;