8

I'm working on an iOS 8 app. I want to change the font on my table view cells, but I've been unable to do so because of automatic dynamic type being applied to them.

Is there a way to turn this behavior off, or must I write my own cell in order to change the font?

  • Have you tried to change font type on iOS7 ?, I got image that you can change font type in iOS7 but can not in iOS8, if you do some code please share it – Jageen Jun 14 '14 at 16:49
  • May help http://stackoverflow.com/questions/20510094/how-to-use-a-custom-font-with-dynamic-text-sizes-in-ios7 – Jageen Jun 14 '14 at 17:11
  • 1
    [Here](http://stackoverflow.com/a/37549824/1971013) is how to override iOS behaviour and get a fixed size category. – meaning-matters May 31 '16 at 18:37

2 Answers2

-2

In your "cellForRowAt indexPath" delegate method change the font style of the 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

}

Then the dynamic type will be overridden with the given font type.

Mithun Ravindran
  • 2,292
  • 2
  • 14
  • 23
-3

Use table view delegate method tableView:heightForRowAtIndexPath:

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 43.5;
}
AllenHu
  • 7
  • 1