PDA

View Full Version : how to change the color of headertitle in table




sandhya.rai
Jun 1, 2009, 07:52 AM
Hi,

I want to know how to change the color of header's title in section of table
programatically .





Thanx
sandhya



johnnyjibbs
Jun 1, 2009, 12:29 PM
You need to use the UITableViewDelegate method tableView:viewForHeaderInSection: (http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITableViewDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UITableViewDelegate/tableView:viewForHeaderInSection:). You can supply it a UILabel object that describes the header text you want for that section and use the label's textColor property to change the colour of the label.

Contrary to what it says in the description, it works for both plain and grouped table view styles.