【发布时间】:2011-02-11 09:45:05
【问题描述】:
我有 UITableViewController。在cellForRowAtIndexPath 方法中,我为标签添加了自定义设置:
UILabel *lblMainLabel = [[UILabel alloc]initWithFrame:CGRectMake(50, 9, 150, 25)];
lblMainLabel.text = c.Name;
lblMainLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:20];
lblMainLabel.backgroundColor = [UIColor clearColor];
lblMainLabel.textColor = [UIColor whiteColor];
[cell.contentView addSubview:lblMainLabel];
[lblMainLabel release];
但是当我在表格中向上或向下滚动时,它总是将此标签添加到我错过的之前的顶部?
【问题讨论】:
标签: iphone objective-c uitableview uilabel