iOS UITableView

作者: 风冰武 | 来源:发表于2018-11-21 10:55 被阅读2次
    设置UITableViewCell的背景色:
    UIView *bgView = [[UIView alloc] initWithFrame:cell.bounds];
    bgView.backgroundColor = UIColor.grayColor;
    cell.backgroundView = bgView;
    
    设置UITableViewCell的选中色:
    UIView *selectedView = [[UIView alloc] initWithFrame:cell.bounds];
    selectedView.backgroundColor = UIColor.redColor;
    cell.selectedBackgroundView = selectedView;
    
    点击cell, 保留cell上控件的背景色:
    (1)在下面的方法中添加控件的背景色
    - (void)layoutSubviews; 
    
    
    
    
    
    
    

    相关文章

      网友评论

        本文标题:iOS UITableView

        本文链接:https://www.haomeiwen.com/subject/uqmqqqtx.html