Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing color of UITableViewCellAccessoryCheckmark and UITextField

I want to change the color of UITableViewCellAccessoryCheckmark and UITextField background color where we type. I found this is not straight forward.

like image 977
Dilshan Avatar asked Oct 21 '10 09:10

Dilshan


2 Answers

I solved this issue by changing the tint color of the UITableView where the cell belongs.

Update the Tint Color of UITableView in interface builder to Default

or programmatically as below.

For Objective C

yourTableView.tintColor =  [UIColor blackColor];

For Swift

yourTableView.tintColor = .black
like image 199
Atanu Mondal Avatar answered Sep 24 '22 14:09

Atanu Mondal


By default,you cannot change the color of UITableViewCellAccessoryCheckmark

But alternatively you can use the image for this..as just like checkmark

while for textField you can use this single line..

[textField setBackgroundColor:[UIColor redColor]];
like image 23
Ajay Sharma Avatar answered Sep 23 '22 14:09

Ajay Sharma