2016-02-24 74 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

回答

相关问题