Can you add subviews to UITableView?

I tried adding UIButton to UITableView by addSubView, but it wont display. Any ideas?

Posted on May 15, 2008 10:27 AM

Reply
7 replies

May 15, 2008 10:58 AM in response to aapl.crox

If it's below all rows why not have 1 top level view that contains both the TableView and the Buttons below it? So:


UIView* container = [[UIView alloc] initWithFrame:goodRect];
UITableView* tv = [[UITableView alloc] initWithFrame:tableRect];
UIButton* btn = [[UIButton alloc] initWithFrame:btnFrame];
[container addSubview:tv];
[container addSubview:btn];
myController.view = container;

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Can you add subviews to UITableView?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.