0

I have a UISplitViewController with a UINavigationController as the masterviewcontroller. This UINavigationController has a UICollectionViewController as its rootViewController. In the UICollectionViewController, I have set the following parameters:

self.collectionView.scrollEnabled = YES;
self.collectionView.bounces = YES;
self.collectionView.alwaysBounceVertical = YES;
self.navigationController.navigationBar.prefersLargeTitles = YES;

UISearchController *sc = [[UISearchController alloc] initWithSearchResultsController:nil];
self.navigationItem.searchController = sc;

The UISearchBar does show up in the navigationBar, but when I launch the app the navbar is collapsed to the small title. It's only when I drag the view downwards that the large title and the search bar appear.

Where I expect the view to launch like this

enter image description here

it actually launches like this

enter image description here

Any ideas what could be causing this?

Keiwan
  • 8,031
  • 5
  • 36
  • 49
user4992124
  • 1,574
  • 1
  • 17
  • 35

1 Answers1

0

Make sure you set preferLargeTitles to true in your UINavigationBar; either in code or in the Storyboard file.

Put this in your viewDidLoad.

self.navigationController?.navigationBar.prefersLargeTitles = true
nathan
  • 9,329
  • 4
  • 37
  • 51
the_kaseys
  • 274
  • 1
  • 2
  • 17