我有一张表。表有一个简单的自定义单元格。这个单元格中只有标签。 这里是cellForRow功能的代码:无法更改UITableviewCell子类中的子视图位置
MyCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
cell.myLabel.text = [NSString stringWithFormat:@"%ld", (long)indexPath.row];
cell.myLabel.frame = CGRectOffset(cell.myLabel.frame, 0, -20);
cell.myLabel.backgroundColor = [UIColor redColor];
return cell;
一切工作正常,除了这一点:
cell.myLabel.frame = CGRectOffset(cell.myLabel.frame, 0, -20);
标签不想动! 我在iOS8中发现了这个问题。
任何人的帮助,请:)
在 MyCell.m
这是最好的答案 – 2015-07-24 08:48:01