我想改变UITableViewCell的宽度。iphone - 改变UITableViewCell的宽度
我已经尝试了一切。现在我想改就
-
(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
// trying everything...
CGRect bounds = cell.contentView.bounds;
bounds.size.width = bounds.size.width * 0.8f;
cell.contentView.bounds = bounds;
cell.backgroundView.bounds = bounds;
cell.selectedBackgroundView.bounds = bounds;
cell.bounds = bounds;
}
变化都没有。有什么想法吗?谢谢
注:我需要表宽度不变,因为这张表有一个必须保持填充所有宽度的背景图像。
尝试设置它的框架,而不是边界 – 2012-01-13 08:30:28
变化都没有。不管怎么说,还是要谢谢你。 – SpaceDog 2012-01-13 09:17:49