2

Is it possible to add a small floating 'settings' button or image-button over a table view? I have buttons on a navigation bar up top, and i dont want to crowd that or remove any

Whyrusleeping
  • 889
  • 2
  • 9
  • 20

3 Answers3

1

This is possible by adding it to the main window as a subview. Another option and my preferred method: Have a main wrapper view, the table view can be added to that wrapper view as a subview, then add your button as another subview inside of the wrapper view and voila

0

Perhaps adding a toolbar with buttons at the bottom would be a better approach?

Erik
  • 7,479
  • 8
  • 62
  • 99
0

To use this method, you should inherit UIViewController and add tableview in it

(1)add button to self.tableview in viewDidLoad()

button.frame = CGRectMake(0, 0, 50, 50);
[self.tableview addsubview:button];  
[self.tableview bringSubviewToFront:button];

(2)set tableview delegate

self.tableview.delegate = self;

(3) add and update button location to self.tableview in scrollViewDidScroll delegate

button.frame = CGRectMake(0, 0, 50, 50);
[self.view addSubview:button];
[self.view bringSubviewToFront:button];

voila~

JoeyJAL
  • 194
  • 1
  • 9