When I show Interstital Ad status bar fades away and Navigation Bar moves up. All content under navigation bar moves up to. When I close the ad everything moves down. It looks really strange and glitchy.
I'm using Navigation Controller in storyboard with Show Navigation Bar
property on.
Code to show Interstital Ad in AppDelegate.m
file:
[self.interstitialAd presentFromRootViewController:self.window.rootViewController];
Basically, I need everything to stay in place without moving when I present Interstital Ad.
Why not try the following:
In the StoryBoard:
OR
Check out the UICatalog Sample from Apple. They provide an example of presenting a search display controller over the navigation bar.
import UIKit
class SearchPresentOverNavigationBarViewController: SearchControllerBaseViewController {
// MARK: Properties
// `searchController` is set when the search button is clicked.
var searchController: UISearchController!
// MARK: Actions
@IBAction func searchButtonClicked(button: UIBarButtonItem) {
// Create the search results view controller and use it for the UISearchController.
let searchResultsController = storyboard!.instantiateViewControllerWithIdentifier(SearchResultsViewController.StoryboardConstants.identifier) as SearchResultsViewController
// Create the search controller and make it perform the results updating.
searchController = UISearchController(searchResultsController: searchResultsController)
searchController.searchResultsUpdater = searchResultsController
searchController.hidesNavigationBarDuringPresentation = false
// Present the view controller.
presentViewController(searchController, animated: true, completion: nil)
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With