Is there a way to enable the bottom toolbar in a Collection View Controller?
Asked Answered
D

2

5

I made and implemented a collection view controller, and now I wish to add a bottom tool bar for navigation purposes. Under the Simulated Metrics tab in the Collection View Controller, I have enabled the bottom toolbar, and it shows up in the storyboard, and I am able to edit and interact with it.

When I run the app in the iPad simulator, the bottom toolbar does not appear. Is there some setting that I am missing that causes it to show in the storyboard and not in the app?

Any suggestions would be appreciated.

Disjoin answered 26/3, 2013 at 12:0 Comment(2)
Leave UICollectionViewController. Use UICollectionView inside UIViewController.Faceplate
Using UICollectionViewController allows you to use layout-to-layout transitions (iOS 7).Breathtaking
R
4

You can embed the UIViewController inside a UINavigationController. In the Storyboard, set the Simulated Metrics for Bottom Bar to one of the Toolbar options on the UINavigationController. You will then notice the Toolbar on the bottom of the UICollectionViewController.

I have done this using Xcode 6.3.2.

Rakes answered 26/5, 2015 at 16:3 Comment(0)
B
3

I had the same problem in Interface Builder.

Adding the toolbar programmatically works fine, though:

// viewWillAppear:

// set up toolbar
UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, self.view.bounds.size.height-44, self.view.bounds.size.width, 44)];
toolbar.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin;
[self.view addSubview:toolbar];

// instantiate spacer, middleItem
toolbar.items = @[spacer, middleItem, spacer];
Breathtaking answered 27/7, 2013 at 10:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.