Swift:将图像添加到uiSearchbar中的scopebar而不是titles

问题描述 投票:0回答:1

我正在尝试将图像设置为uisearchbar中的范围栏。我知道可以在分段控制中执行此操作,但我无法弄清楚如何在范围栏中执行此操作。

swift uisearchbar
1个回答
0
投票

重复:这已被回答HERE

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

© www.soinside.com 2019 - 2024. All rights reserved.