有没有可能在UITableView中更改字体的types和大小?

我想更改UITableView字体types和大小。 例如,我将如何将它设置为Tahoma?

 cell.textLabel.font = [UIFont fontWithName:@"ArialMT" size:144]; 

其中cell是一个UITableViewCell你将在-tableView:cellForRowAtIndexPath:返回-tableView:cellForRowAtIndexPath:

Tahoma默认不附带iOS,如果没有适当的许可,您也不能合法复制它。 但是,如果您不喜欢Arial,则可以提供自定义的免费字体,请参阅如何在iPhone SDK中包含和使用新字体?

要添加到KennyTM的答案:

你可以使用- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath UITableView委托方法来configuration你的UITableViewCell是这样的:

  - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { cell.textLabel.textColor=[UIColor whiteColor]; cell.detailTextLabel.font=[UIFont fontWithName:@"Helvetica" size:16.0]; cell.detailTextLabel.textColor=[UIColor whiteColor]; } 

苹果公司的文件显示

表视图在它使用单元格绘制行之前将其发送给它的委托,从而允许委托在显示之前自定义单元对象。 此方法使委托有机会覆盖表视图较早设置的基于状态的属性,如select和背景颜色。 在委托返回之后,表视图只设置alpha和frame属性,然后仅在行滑入或滑出时为其设置animation。