How can I change color of a section header in UITableView?
EDIT: The answer provided by DJ-S should be considered for iOS 6 and above. The accepted answer is out of date.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Hopefully this method from the
UITableViewDelegateprotocol will get you started:Objective-C:
Swift:
Updated 2017:
Swift 3:
Replace
[UIColor redColor]with whicheverUIColoryou would like. You may also wish to adjust the dimensions ofheaderView.