去掉UITableViewController黑色线条
2017-05-14 本文已影响54人
就那两三事
像UIToolBar,UISearchBar这类控件,都自带背景视图,如果放在UINavigationBar上就会有问题(下图),如果只设置背景颜色透明是没有任何作用的。

想不带背景,只能想办法把背景视图移除,或者不用bar类型控件,而是用普通的UIView实现。
去掉背景线条显示(Xcode8),在UITableViewController文件下的viewDidLoad中添上:
<pre>
self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
self.tableView.separatorColor = [UIColor clearColor];
</pre>
最后,
