Ulugbek
Ulugbek

Reputation: 147

How to change the color of seperator in tableView?

I am currently creating collectionView cells inside of TableViewCell but I want to separate each TableViewCell with default separator but changing its color. Please help me with this. Or Can I remove all separator lines and use custom UIView to separate them?

Upvotes: 0

Views: 86

Answers (2)

PGDev
PGDev

Reputation: 24341

Simply update the separatorColor property of tableView with the required UIColor instance.

tableView.separatorColor = .red

In case you want to update it via storyboard, you can with the tableView's attributes inspector like,

enter image description here

Upvotes: 5

Muneeb Ali
Muneeb Ali

Reputation: 482

You can also set the separatorColor from storyboard.

enter image description here

Upvotes: 1

Related Questions