【问题标题】:How to add rows to UITableView dynamically? [closed]如何动态向 UITableView 添加行? [关闭]
【发布时间】:2012-01-24 08:10:32
【问题描述】:

需要应用程序将行动态添加到 TableView。如何实现?


这似乎不起作用:

NSIndexPath *path = [[NSIndexPath alloc]initWithIndex:(rowCount - 1)]; 
[self.tableView insertRowsAtIndexPaths:
    [NSArray arrayWithObject:path] withRowAnimation:UIViewAnimationCurveEaseIn]; 

【问题讨论】:

  • 你有没有尝试过——你有什么代码可以给我们看吗?
  • 您必须为您的问题添加一些细节。否则得不到好的答案。查看UITableView

标签: objective-c ios uitableview


【解决方案1】:

看看:

-(void)insertRowsAtIndexPaths:(NSArray *)indexPaths     
       withRowAnimation:(UITableViewRowAnimation)animation

如果您在写这个问题时等待一段时间,您会看到很多 类似问题的建议。

【讨论】:

  • 问题是它对我不起作用.. NSIndexPath *path = [[NSIndexPath alloc]initWithIndex:(rowCount - 1)]; [self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:path] withRowAnimation:UIViewAnimationCurveEaseIn];
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-04-07
  • 1970-01-01
  • 2014-06-02
  • 2012-11-08
  • 1970-01-01
  • 2013-03-26
相关资源
最近更新 更多