代码之家  ›  专栏  ›  技术社区  ›  an0

如何在UITableView中初始选择行

  •  9
  • an0  · 技术社区  · 16 年前

    selectRowAtIndexPath:animated:scrollPosition: 到 最初 UITableView UITableViewController (否则将发生过度绑定异常)。

    3 回复  |  直到 12 年前
        1
  •  6
  •   Darren    16 年前

    你需要使用 viewWillAppear:

    或者,为了更好地控制,实施 loadView viewDidLoad ,及 viewDidUnload .

        2
  •  3
  •   Jessedc    10 年前

    尝试超载 viewWillAppear:animated viewDidAppear:animated

    一定要打电话 selectRowAtIndexPath:indexPath animated:NO

        3
  •  2
  •   Rahul Vyas    16 年前

    您可以在uitableview的cellforrowatindexpath方法中设置选中的任何单元格。使用cell.selected=YES;

    推荐文章