2016-02-24 92 views
0

我已經創建了一個帶有彈出式大小按鈕的工具欄,以及相應的文本字段與日期選擇器交互時。如何更改UIBarButtonItem的字體樣式和大小?

截圖:

enter image description here

我希望能夠更改按鈕的字體樣式和大小。

代碼段:

UIToolBar創作:

/*** ToolBar setup DatePicker ***/ 
    let toolBar = UIToolbar(frame: CGRectMake(0, self.view.frame.size.height/6, self.view.frame.size.width, 40.0)) 
    toolBar.layer.position = CGPoint(x: self.view.frame.size.width/2, y: self.view.frame.size.height-20.0) 
    toolBar.barStyle = UIBarStyle.Default 
    toolBar.tintColor = UIColor.init(red: 0, green: 122/255, blue: 1, alpha: 1.0) 
    toolBar.backgroundColor = UIColor.grayColor() 

UIBarButton聲明:

let okBarBtn = UIBarButtonItem(title: "Done", style: UIBarButtonItemStyle.Done, target: self, action: "donePressed:") 
+0

在對Stack Overflow提出問題之前,請務必檢查文檔。 – matt

回答

相關問題