2017-09-25 125 views
-1

這裏草圖:如何使空間的導航欄和時間之間迅速

img

而且我當前的代碼:

let screenSize: CGRect = UIScreen.main.bounds 
let navBar = UINavigationBar(frame: CGRect(x: 0, y: 0, width: screenSize.width, height: 80.0)) 
let navItem = UINavigationItem(title: "") 
let doneItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.done, target: nil, action: #selector(done)) 
navItem.leftBarButtonItem = doneItem 
navBar.setItems([navItem], animated: false) 
self.view.addSubview(navBar) 

回答

0

這篇文章應該是與你有關的。它將允許您將額外的填充添加到標籤的內部。或者,您可以稍微增加標題的高度,或將20(條形的高度)約束添加到標籤。

Adding space/padding to a UILabel