2012-11-26 30 views

回答

0

我发现了一个很简单的方法来做到这一点。

The details of how to do so are here.

本教程介绍了如何建立一个UICollectionView补充意见(页眉或页脚)。我只是将我的标签和按钮添加到我的自定义补充视图中,瞧!

0

你可以试试这个...这帮助我......

  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
      { 
       return [array count]+1; 
       } 



      - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
       { 
       if (indexPath.row == ([array count]+1)) { 
        UILabel * headerLabel = [[UILabel alloc] initWithFrame:CGRectZero]; 
        headerLabel.text = @"your text"; 
        headerLabel.frame = CGRectMake(110.0, 11.0, 100.0, 20.0); 
        [cell addSubview:headerLabel]; 
        } 
       else 
        { 
        } 
       } 

我希望这会帮助你。

编码快乐。

+0

感谢您的答复。它看起来像你正在给最后一个单元格的底部添加一个标签。当你尝试重新组织你连接headerLabel的单元时会发生什么?它不会与单元格一起重新排序吗? –

相关问题