【发布时间】:2018-05-17 11:09:20
【问题描述】:
当我将应用程序从 iOS SDK 10 更新到 11 时,我将 UIViewController 中的搜索栏从 UIView 移动到了 navigationItem。
此外,我将背景图像设置为在UISearchBar 中放置一个垂直偏移量,因为徽标和searchBar 之间的距离很小。
searchBar.setSearchFieldBackgroundImage(searchFieldImage, for: .normal)
searchBar.searchFieldBackgroundPositionAdjustment = UIOffset(horizontal: 0, vertical: 4)
但我不能将“取消”按钮垂直放置。如何设置UISearchBar中的取消按钮或按钮中的标题的垂直位置?
【问题讨论】:
标签: ios swift uisearchbar ios11 uisearchcontroller