-1
與setAdjustsFontSizeToFitWidth改變字體我想調整的UITableViewCell的標籤字體,所以我使用了下面的代碼:的UITableViewCell爲textLabel不是iphone
static NSString *CellIdentifier = @"ItemCell";
UITableViewCell *cell = nil;
if (cell == nil)
{
cell = [[[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleValue1
reuseIdentifier:CellIdentifier] autorelease];
cell.accessoryType = UITableViewCellAccessoryNone;
}
if (indexPath.section == 0)
{
NDOrderItem *item = [self.order.items objectAtIndex:indexPath.row];
//[cell.textLabel setMinimumFontSize:10];
//[cell.textLabel setAdjustsFontSizeToFitWidth:YES];
cell.textLabel.text = item.name;
cell.detailTextLabel.text = [NSString stringWithFormat:@"%d",item.quantity];
}
但setAdjustsFontSizeToFitWidth不調整爲textLabel的字體。
這個代碼不工作 –