目標C對我來說是新的。如何更改表格視圖中文本字段的字體?這是我現在有代碼:如何在表格視圖中更改文本字段的字體
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
if (indexPath.section==0)
{
UITextField *textField= [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 205, 21)];
textField.placeholder = @" ";
//textField.text = [listOfItems objectAtIndex:indexPath.row];
textField.tag = indexPath.row;
//textField.textLabel.font = [UIFont fontWithName:@"Helvetica" size:12];
//textField.placeholder = [TeamBDict objectAtIndex:textField.tag];
textField.delegate = self;
cell.accessoryView = textField;
[textField release];
}
的註釋行也將這樣做。 'textField.textLabel.font = [UIFont fontWithName:@「Helvetica」size:12];' – 2012-03-23 15:18:15
請閱讀stackoverflow的FAQ。 – Danra 2012-03-23 15:18:21