部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