2009-10-03 29 views
1

所有iphone开发商定制示例的UITableView(分组方式)

我目前正在开发iPhone应用程序,其中我显示在分组式的分段控制的段中的一个一个UITableView。

我的问题是,我不知道如何在表头视图动态显示的小图像。

另一个问题是,我不知道如何显示标签和按钮或在特定部分的一个细胞的任何其他控制,也使他们多行。

如果任何一个有代码或示例,请帮我做这个。

回答

0

它可以通过这个代码来完成:

GRect newFrame = CGRectMake(0.0, 0.0, self.myDetailView.bounds.size.width, 50.0); 
    UIView *trialHeaderView = [[UIView alloc] initWithFrame:newFrame]; 
    trialHeaderView.backgroundColor = [UIColor clearColor];      

    UIImageView *myImageView = [[UIImageView alloc]initWithFrame:CGRectMake(15, 10, 35, 35)]; 
    myImageView.image = [UIImage imageNamed:@"r1.jpg"]; 
    myImageView.contentMode = UIViewContentModeScaleToFill; 
    [trialHeaderView addSubview:myImageView]; 

myDetailView.tableHeaderView = trialHeaderView; 

确定..

2

这人会,以期取代你的头,你可以添加任何东西有:

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { 
}