Customize UISearchBar: Trying to get rid of the 1px black line underneath the search bar June 10, 2023 by Tarik Try this searchBar.layer.borderWidth = 1; searchBar.layer.borderColor = [[UIColor lightGrayColor] CGColor];