How to remove border of UISearchbar?

uisearchbar remove padding
xamarin forms search bar remove border
uisearchbar background color
search bar swift
swiftui search bar
uisearchbar attributed text
uisearchbar default height
uisearchbar textfield background color

As per as design I tried to remove the border of uisearchbar but failed. can you please help or suggest?

I want to create like below design.

If this custom search bar? Mb you need something like this:

searchBar.backgroundImage = [UIImage new];

This removes background. And after this set this:

searchBar.barTintColor = [UIColor whiteColor];

Or mb you are need to try this:

searchBar.layer.borderColor = [[UIColor YOUR_COLOR_HERE] CGColor];

And another case:

topSearchBar.barTintColor = [UIColor clearColor];

Mb this help you

Remove top and bottom border of UISearchBar and shadow , Set the bar's backgroundImage to an empty UIImage , not nil : searchBar.​backgroundImage = UIImage(). You may also set the barTintColor , as  Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Learn more Remove Border of UISearchBar in iOS7

To obtain this design make below changes in storyboard.

and

then add below code into your viewdidload or whatever you want.

self.bar.layer.cornerRadius = self.bar.frame.height/2
    self.bar.layer.masksToBounds = true

then I think you will get your desire design.let me know if it works or not .

Remove top and bottom border of UISearchBar and shadow? iOS , I am developing in Swift 1.2. I have created a .xib with a UISearchBar. I am looking to remove the top and bottom borders as seen in this image:  When I added a UISearchBar to UITableView.tableHeaderView, it shows a border. So in order to remove the 1px, just

After the trial, I found a solution which is working for me. I set the color like super view's color. That's why it is not visible and then I wrote some lines of code in viewDidLoad().

    override func viewDidLoad() {

        super.viewDidLoad()

        searchBar.backgroundImage = UIImage()
        searchBar.delegate = self
        let textFieldInsideSearchBar = searchBar.value(forKey: "searchField") as? UITextField
        textFieldInsideSearchBar?.textColor = UIColor.black
        textFieldInsideSearchBar?.leftViewMode = UITextFieldViewMode.never
    }

UISearchBar Appearance, Hi Everyone! So, I've been playing around with UISearchBar and am a little stuck. There is a 1px border that I can't seem to get rid of. The code  The shadow we’re trying to remove is a hairline UIImageView somewhere under UINavigationBar. We can find it and hide/show it when needed. We can find it and hide/show it when needed. Instructions below assume you need hairline hidden only in one controller of your UINavigationController hierarchy.

Remove Border of UISearchBar in iOS7, I'm trying to remove border of UISearchBar in iOS 7. In iOS 6 it's working fine. I created the UISearchBar programatically. I tried almost every  Ugly Code for an Attractive UISearchBar 22 Feb 2015. Getting an iOS view to look exactly how you want it can be super frustrating. Take, for example, the simple requirement of hosting a UISearchBar inside a UITableViewCell.

searchBarStyle, I'm trying to remove border of UISearchBar in iOS 7. In iOS 6 it's working fine. I created the UISearchBar programatically. I tried almost every thing from Stack  Remove top and bottom border of UISearchBar and shadow , Set the bar's backgroundImage to an empty UIImage , not nil : searchBar. borderWidth = 10 searchBar.layer

Remove the 1px Shadow From UISearchBar, searchBarStyle. A search bar style that specifies the search bar's appearance. SDKs. iOS 7.0+; Mac Catalyst 13.0+; tvOS 9.0+. Framework. UIKit. On This Page.

Comments
  • What have you tried so far? Can you please share the code ?