left、right barItems與系統(tǒng)的barItem與屏幕邊距差異
解決方法:
通過定義額外的barItem
let spaceBarItem = UIBarButtonItem.init(barButtonSystemItem: .FixedSpace, target: nil, action: nil)
spaceBarItem.width = -12
self.navigationItem.leftBarButtonItems = [spaceBarItem, UIBarButtonItem.init(customView: textField)]
自定義返回backBarItem時(shí),系統(tǒng)左滑返回失效
解決方法:
let backBarButtomItem = UIBarButtonItem.init(image: UIImage.init(named: "backStretchBackgroundNormal"), style: .Plain, target: self, action:#selector(XcfBuyBuyBuyVIewController.navgationPop))
self.navigationItem.leftBarButtonItem = backBarButtomItem
self.navigationController!.interactivePopGestureRecognizer!.delegate = self
隱藏返回按鈕,左滑時(shí)導(dǎo)航欄出現(xiàn)三個(gè)點(diǎn)
解決方法:
定義一個(gè)空的leftBar
let leftBarView = UIView.init(frame: CGRectZero)
let leftBarItem = UIBarButtonItem.init(customView: leftBarView)
self.navigationItem.leftBarButtonItem = leftBarItem