UISearchBar custom corners

前端 未结 5 1627
星月不相逢
星月不相逢 2020-12-31 06:46

I\'m trying to create a search bar like this:

\"enter

But I\'m noticing that I

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-31 07:19

    You should change the radius of searchTextField inside UISearchBar .

    you can do that like this :

    searchBar.searchTextField.layer.cornerRadius = 20
    searchBar.searchTextField.layer.masksToBounds = true
    

    * searchBar is an outlet of UISearchBar from storyBoard

提交回复
热议问题