ios - 如何从表格 View 行单元格中删除单独的行?

标签 ios objective-c uitableview

全部

如何从 UITableView 单元格行中删除单独的行。 我试过了,但仍然在 UITableViewCell 行中绘制了一条单独的线。

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *CellIdentifier = @"Cell";    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
        cell.selectionStyle = UITableViewCellSeparatorStyleNone;
        self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    cell.backgroundColor = [UIColor colorWithRed:217.0/255.0 green:235.0/255.0 blue:244.0/255.0 alpha:1.0];
    cell.textLabel.text = LOREM;
    [cell.textLabel setFont:[UIFont fontWithName:@"GillSans" size:12.0]];
    cell.textLabel.numberOfLines = 0;
    return cell;
} 

错误图片:- enter image description here

最佳答案

尝试将 self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 放入您的 viewDidLoad... 而不是 cellForRow......

关于ios - 如何从表格 View 行单元格中删除单独的行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37391673/

相关文章:

iphone - 在 Facebook 上显示应用名称 分享 iPhone

ios - CFSocketSetAddress 绑定(bind)失败 : 48 after reopening stream

objective-c - 在回调函数中使用 ExtAudioFileWriteAsync()。无法运行

ios - 如果 UITextField 是在 UITableViewCell 中以编程方式创建的,如何退出第一响应者?

ios - 使用segmentcontroller改变tableview

ios - 如何防止 IOS Swift 上的 OneSignal 在处理通知时打开 WebView

ios - 免费设置配置文件过期后,iOS上的Xamarin App崩溃

iphone - 如何从 UILabel 创建图像?

objective-c - Swift 扩展 - 将 Json 解析为 NSDictionary 模型(通过使用类似于 Obj-C 中的类别)

ios - UITableViewCell 为不同的方向和单元格类型加载自定义 XIB