UISearchBar custom corners

前端 未结 5 1613
星月不相逢
星月不相逢 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:34

    The issue here is you are setting the corner radius on the UISearchBar, not the UITextField inside it. You can do some sort of hack to get the UITextField, but that's not really recommended.

    As you mentioned in your question, you'll need to use custom images and the methods shown here: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UISearchBar_Class/#//apple_ref/doc/uid/TP40007529-CH3-SW40

提交回复
热议问题