Jacksonkr
Jacksonkr

Reputation: 32247

add content to top portion of a UITableView programmatically

In the Interface Builder you can drag a UI element (such as a UITextField) to a grouped UITableView and it allows you to attach that view to the top or bottom of the table.

How can I do this programmatically? (also, what is this called?)

Upvotes: 0

Views: 72

Answers (2)

bryanmac
bryanmac

Reputation: 39306

UITableView has tableHeaderView and tableFooterView properties you can set.

Upvotes: 1

Sree
Sree

Reputation: 907

You can add the textField as the headerView or Footer view of the tableView.

Upvotes: 1

Related Questions