marionmaiden
marionmaiden

Reputation: 3350

Overlap iOS components viewController

I have a UITableView in my View Controller and I would like to place two buttons (one on the left and other on the right side of the UITableView), overlapping this component.

How would I do this? If I place a button in one of the sides, the UITableView shrinks to fit the new button, but I'd like to view it over the table.

Upvotes: 0

Views: 143

Answers (1)

Kevin
Kevin

Reputation: 17586

Create the button as a subview of the view controller's view (this is easiest to do in code, because interface builder would automatically add the button as a subview of the UITableView

UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(40,40,80,80)]; //Whatever your need and repeat for your second button
[self.view addSubview:button];

Upvotes: 1

Related Questions