Feroz Feroz - 4 months ago 17
Objective-C Question

How to add image and title to header of table view IOS

In table view I have created header.

What is the correct way to set image or title in tableView's header? What I need to do?

TIA

Neo Neo
Answer

In the method

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section

you need to create a UIView and add other views like UIImageView(for image), UILabel(for title) and return the UIView at last.