【发布时间】:2018-08-08 04:10:24
【问题描述】:
我想更改 Searchcontroller searchBar 中占位符的文本对齐方式。
我使用这个 Swift 代码在我的导航控制器中创建搜索栏:
@IBAction func searchwithAddress(_ sender: Any) {
let searchController = UISearchController(searchResultsController: searchResultController)
searchController.searchBar.delegate = self
searchController.obscuresBackgroundDuringPresentation = false
searchController.searchBar.becomeFirstResponder()
definesPresentationContext = true
self.present(searchController, animated: true, completion: nil)
}
如何将 textalign 用于我的搜索栏?
【问题讨论】:
-
您必须为此创建自定义控制器,Here is what you looking for
标签: ios swift uisearchbar uisearchcontroller