在iOS 8中更改UISearchController视图高度的高度?

时间:2015-05-26 17:34:50

标签: ios swift uiviewcontroller ios8 uisearchcontroller

我在我的视图中添加了一个UISearchController,但我想改变它的高度。这就是我所拥有的:

func initSearch() {
    // Create the search controller and make it perform the results updating.
    searchController = UISearchController(searchResultsController: nil)

    searchController.delegate = self
    searchController.searchBar.delegate = self

    searchController.hidesNavigationBarDuringPresentation = true
    searchController.dimsBackgroundDuringPresentation = true

    searchController.searchBar.tintColor = UIColor.whiteColor()
    searchController.searchBar.barStyle = .Black

    searchController.searchBar.scopeButtonTitles = [ "Any", "Title", "Content", "Keywords" ]

    self.definesPresentationContext = true
}

@IBAction func searchTapped(sender: AnyObject) {
    // Present the view controller.
    presentViewController(searchController, animated: true, completion: nil)
}

下面是它的外观截图。我想从高处修剪一些空间。怎么办呢?

enter image description here

0 个答案:

没有答案