Thursday, April 11, 2024
HomeiOS Developmentios - UISearchBar not exhibiting default search icon

ios – UISearchBar not exhibiting default search icon


I’m utilizing UISearchBar as titleView of navigationItem (FYI UISearchController does not go well with my anticipated UI). The default magnifying glass icon shouldn’t be proven in searchBar.

That is my code:

    lazy var searchBar: UISearchBar = {
        let _searchBar = UISearchBar()
        _searchBar.searchBarStyle = .minimal
        _searchBar.isTranslucent = true
        _searchBar.delegate = self
        _searchBar.placeholder = "Some Placeholder"
        return _searchBar
    }()

override func viewDidLoad() {
tremendous.viewDidLoad()
navigationItem.titleView = searchBar
}

I attempted altering searchBarStyle property however of no use. I’m checking on iOS 17.4.1.

I do know that we are able to manually set icon utilizing leftView property of UISearchTextField nevertheless it does not look good.

Is there any method to make the default magnifying glass icon to indicate up on main facet of searchBar ?



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments