部8改變字體標題我想改變一個節頭的字體類型和字體大小在表視圖控制器。迅速IOS在的tableview
我的代碼:
func tableView(tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) {
let header = view as! UITableViewHeaderFooterView
header.textLabel.textColor = UIColor.blackColor()
header.textLabel.font = UIFont(name: "Futura", size: 38)!
}
但是,這是行不通的。有任何想法嗎?
富利字體文件必須有該字體包含項目文件夾裏面 – iRiziya
。單元格文本也有這種字體, – Ghost108
ok ..然後嘗試'viewForHeaderInSection'方法中的上述代碼。併爲標題文本標籤'var title = UILabel()title.font = UIFont(name:「Futura」,size:38)! title.textColor = UIColor.lightGrayColor()'然後'header.addSubview(標題)' – iRiziya