我试图将子视图添加到UITableView中的一个部分,它看起来像代码是正确的,它不显示任何内容,只是空白部分。下面是我使用的代码:将子视图添加到UITable
- (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 [email protected]"<>";
}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'的价值是什么? – 2011-06-02 08:36:32
它是一个类,其中有一个page.xib类..我试图将xib的视图添加到表部分.. – 2011-06-02 08:42:06