Change border color of a UITableViewCell on selection

后端 未结 3 439
时光取名叫无心
时光取名叫无心 2020-12-28 17:45

I am using a custom table view cell for my tableview. For setting the border, I have put a view on the custom cell and I am changing its border properties.

s         


        
3条回答
  •  生来不讨喜
    2020-12-28 17:53

    You can use Objective-C

    [cell.contentView.layer setBorderColor:[UIColor blackColor].CGColor]; 
    [cell.contentView.layer setBorderWidth:2.0f]; 
    

    Swift 5

    cell.layer.borderColor = UIColor.black.cgColor
    cell.layer.borderWidth = 2.0
    

    Hope it helps you.

提交回复
热议问题