I have a .xib containing a bottom bar view. It has a button that shows a view. I use that bottom bar in almost every view controller and I can't make it work even after searching for over two hours.
Clicking in the bottom bar is working fine (NSLog
shows that the button actions are being called when I click them), but I can't find a way to do what I want. The button needs to show a UITableViewController
with 6-7 rows in a specific frame so I don't want to fully use the screen.
|------|
| |
| |
| |
| |
|______|
|+_____|
|------|
| |
| |
|------|
| here |
|______|
|+_____|
In the above figure, the "+" sign is the button, and it needs to show the UITableViewController
in the position marked "here" just above the bottom bar.
I'm new to iOS and I'm banging my head against a wall because of this.
Thanks in advance!
A UITableViewController expects to use the entire screen. I don't think it's what you want here.
I'd just create a UIView subclass and add a UITableView to it. You can then add your custom view to the current view as a subview. Your subclass can be the data source and delegate, so it can be completely self-contained so you can use it anywhere in the app. It can also be full-screen sized if you want to detect tapping outside of the table view to dismiss the custom view. Just make the backgroundColor clearColor and add a gesture recognizer to detect the tap.