Oliver
Oliver

Reputation: 23510

iPhone - Changing label text into a TableView "header"

I've created this view using XCode4, dropping a UILabel onto the top part of a UITableView.
The Label is connected to an IBOutlet of the File's owner but I can't change it programmaticaly.

enter image description here

That part of text doesn't seem to be into a header. Where is it ?
And the most important, how may I change it or best : hide it ?

Upvotes: 0

Views: 1059

Answers (1)

Legolas
Legolas

Reputation: 12325

Use this in the ViewDidLoad.

UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 45)];
label.text = @"HEADER VIEW";

self.tableView.tableHeaderView= label;

Upvotes: 3

Related Questions