ios - 普通 TableView 分隔符未删除

标签 ios objective-c iphone uitableview

我有一个普通 UITableView 并且我想隐藏分隔符。为了隐藏它,我尝试使用以下属性:

我也在 viewDidLoad 中设置了它。

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

UITableView 中仍然有分隔符。我怎样才能删除它?

最佳答案

对于 Objective-C

[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];

对于 swift

self.tableView.separatorStyle = UITableViewCellSeparatorStyle.None;

关于ios - 普通 TableView 分隔符未删除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44195915/

相关文章:

ios - JSON 字符串编码 - 混淆

ios - 如何播放本地文件中的音频?

ios - 如何在不通知 NSFetchedResultsController 的情况下更新 NSManagedObject 或 NSManagedObjectContext

iphone - 如何检查 iPhone 中的日期有效性?

ios - iOS 上的滚动因溢出元素而跳跃(lightwindow)

ios - pod update 没有获得最新版本的 pod

ios - 捏合和点击手势无法正常工作

ios - 使用 CAGradientLayer 定义渐变的角度

ios - unichar characterAtIndex 具有特定字符

iphone - 如何设置旧 iPhone 进行开发测试?