iOS 7 UIToolBar Overriding With Status Bar

前端 未结 6 1457
你的背包
你的背包 2020-12-06 07:20

I have upgraded my project from iOS 6 to iOS 7 but there seems a little problem. The status bar and a tool bar is overriding and very close to each other. The tool bar was e

6条回答
  •  猫巷女王i
    2020-12-06 07:42

    Swift 3

    Connect your bar delegate and conform to UIToolbarDelegate. Then add this delegate method:

    func position(for bar: UIBarPositioning) -> UIBarPosition {
        return UIBarPosition.topAttached
    }
    

    because now

    enum UIBarPosition : Int {
        case any
        case bottom
        case top
        case topAttached
    }
    

提交回复
热议问题