【发布时间】:2009-10-31 04:30:30
【问题描述】:
当我滚动时,我的 tableview 显示如下......你能帮我解决我犯了什么错误吗?有什么帮助吗?如果你看到那张图片,我在改写时选择的值........
http://www.freeimagehosting.net/image.php?fa76ce6c3b.jpg
代码是
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell.textLabel.font = [UIFont boldSystemFontOfSize:14.0];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
CGRect rectLbl2 = CGRectMake(75 ,1, 215, 32);
CGRect rectLbl3 = CGRectMake(75 ,28, 215, 30);
addLabel2= [[UILabel alloc] initWithFrame:rectLbl2];
addLabel3= [[UILabel alloc] initWithFrame:rectLbl3];
addLabel2.text = @"senthil";
[cell addSubview:addLabel2];
[addLabel2 release]; // for memory release
addLabel3.text= @"senthil";
[cell addSubview:addLabel3];
[addLabel3 release];
return cell;
}
【问题讨论】:
-
如果您发布用于将内容放入单元格的代码,我们会更容易为您提供帮助。例如,
-tableView:cellForRowAtIndexPath:方法中的代码。
标签: iphone