Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the backgroundColor of IndexBar for UITableView in iOS7?

I need to change the backgroundcolor of IndexBar for UITableView in iOS7.

For Default , IndexBar backgroundColor is white and textColor is blue like following pic.

enter image description here

I want to change the backgroundColor to clearColor and textColor to red.

How can i do that in iOS7?

like image 735
Fire Fist Avatar asked Sep 30 '13 04:09

Fire Fist


People also ask

How do I change the tableView style in Swift?

You cannot change the table style once it's initialised. You'd have to create a new UITableView instance with a different style.

How do I change the color of a table in Swift?

In the Storyboard menu for the viewController of your tableView, click on yourViewController. The first dropdown inside the viewController. (The first dropdown will contain your tableView and cellView. It can also contain other goodies depending on your particular project).


1 Answers

Sorry. I got my answer for my own question.

Here is codes

[[self tableView] setSectionIndexColor:[UIColor redColor]];
[[self tableView] setSectionIndexBackgroundColor:[UIColor clearColor]];
like image 168
Fire Fist Avatar answered Sep 27 '22 18:09

Fire Fist