我有一个可变数组。我想在 UITableView 中设置文本框架。
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
cell.textLabel.text = [appDelegate.UnitTypeAry objectAtIndex:indexPath.row];
cell.textLabel.frame = CGRectMake(10, 10, 150, 40);
最佳答案
您需要实现一个继承 UITableViewCell 的新类,并在单元格的 contentView 属性中添加标签。
更改标签的框架
-(void)layoutSubviews
{
}
你的新细胞类
关于ios - 如何在 iphone 的 UITableview 单元格中设置文本位置数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19994757/