UITableView separator line disappears when selecting cells in iOS7

后端 未结 24 2159
耶瑟儿~
耶瑟儿~ 2020-12-05 04:01

In my tableView I set a separator line between cells. I am allowing selection of multiple cells. Here\'s my code for setting selected cell background color:

         


        
24条回答
  •  囚心锁ツ
    2020-12-05 04:19

    Past it in your UITableViewCell class.

    override func layoutSubviews() {
        super.layoutSubviews()
    
        subviews.forEach { (view) in
            if type(of: view).description() == "_UITableViewCellSeparatorView" {
                view.alpha = 1.0
            }
        }
    }
    

提交回复
热议问题