how can I remove the top border on UIToolBar

后端 未结 11 707
一生所求
一生所求 2021-02-02 05:14

I have set my UIToolBar tint color to some value, and there is this border line that I see in which I want to remove:

11条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-02 05:47

    I got a bit confused with these answers but I was missing the point that you were using an Outlet so just to be clear here is the swift code I used to hide the border:

    import UIKit
    
    class ViewController: UIViewController {
    
        //MARK Outlets
        @IBOutlet weak var ToolBar: UIToolbar!
    
        //MARK View Functions
        override func viewDidLoad() {
            super.viewDidLoad()
            // Do any additional setup after loading the view, typically from a nib.
    
            // Hide the bottom toolbar's top border
            ToolBar.clipsToBounds = true
        }
    }
    

    I had dragged a toolbar to the bottom of a view for this and it's not the top nav bar some other questions refer to.

提交回复
热议问题