-3

I am using storyboards to make a search bar using UISearchBar. I am trying to make it look like this: sketch design

However this is what I end up getting: actual app

I've added code to change the bar's dimensions and set a minimum font size for the text (for auto layout) and add corner radius. The only code that works is the corner radius unfortunately.

searchBarOutlet.layer.cornerRadius = 10 searchBarOutlet.layer.borderWidth = 304 searchBarOutlet.clipsToBounds = true

Bob Filay
  • 23
  • 4

1 Answers1

0

You can set the search bar style to "Minimal" in the properties inspector, I think that's more close to what are you looking for, regarding the the font size and autolayout issues I think there is no way to access those properties in the UISearchBar, but there are workarounds like the one specified here Change the font size of UISearchBar

The other workaround you can try it's making your own "loook a like" search bar, which shouldn't be that hard, maybe the hardest part will be to add small icon to the left of the placeholder

Samuel Chavez
  • 768
  • 9
  • 12