swift : Add image to scopebar in uiSearchbar instead of titles

标签 swift uisearchbar

我正在尝试将图像设置为 uisearch 栏中的范围栏。我知道可以在分段控制中做到这一点,但我不知道如何在范围栏中做到这一点。

最佳答案

Duplicate: This has been answered HERE:

searchBar.setImage(UIImage(named: "your image"), forSearchBarIcon: .Search, state: .Normal)

关于 swift : Add image to scopebar in uiSearchbar instead of titles,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49034136/

相关文章:

xcode - Swift - 从 userDefaults 保存和检索图像

ios - 解析 : How can I update all rows with the same key value

iphone - 最初激活 UISearchBar 时显示 searchResultsTableView

ios - 当 searchBar 在部分标题中时,UICollectionView reloadData 退出第一响应者/关闭键盘

ios - UIViewController 内的 UIsearchController 使用自动布局

swift - 如何通过 Swift 执行一个函数直到 Firestore 完成下载数据?

swift - 为什么 CloudKit 不允许我将任何记录保存到默认容器的公共(public)数据库中?

swift - URLComponents 在添加路径时添加神秘字符

html - 搜索框展开时向左移动菜单项

swift - 隐藏导航栏后面的tableHeaderView