【发布时间】:2011-06-02 08:30:57
【问题描述】:
我正在尝试将子视图添加到 UITableView 的一个部分中,看起来代码是正确的,它没有显示任何内容,只是空白部分。这是我使用的代码:
- (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];
}
if(indexPath.section==0){
cell.textLabel.text =@"<>";
}else if(indexPath.section==1){
if(indexPath.row==1){
cell.frame =CGRectMake(0,0, 100, 100);
[cell.contentView addSubview:page.view];
}
} else if(indexPath.section==2){
}
// Configure the cell.
return cell;
}
提前谢谢..
【问题讨论】:
-
什么是
page?page.view.frame的值是多少? -
这是一个类,一个包含 page.xib 的类.. 我正在尝试将 xib 的视图添加到表格部分..
标签: ios uitableview uiview xcode4