我正在开发iOS 8应用程序.我想更改表格视图单元格上的字体,但由于应用了自动动态类型,我无法这样做.
有没有办法关闭此行为,或者我必须编写自己的单元格才能更改字体?
解决方法
在“cellForRowAt indexPath”委托方法中,更改textLabel的字体样式.
func tableView(_ tableView: UITableView,cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "cell") cell?.textLabel?.font = UIFont(name: "HelveticaNeue-Medium",size: 16.0)! //your code// return cell }
然后将使用给定的字体类型覆盖动态类型.