【问题标题】:Set selected cell in UITableView initialization在 UITableView 初始化中设置选中的单元格
【发布时间】:2012-06-26 02:35:45
【问题描述】:

我想在UITableView完成初始化后将单元格编号0设置为选定单元格?

我尝试过:

[cell setSelected:YES];

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

但单元格颜色变为黑色。

【问题讨论】:

    标签: objective-c uitableview selection


    【解决方案1】:

    UITableView 本身可以管理选择。尝试调用:

    - (void)selectRowAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UITableViewScrollPosition)scrollPosition
    

    【讨论】:

      猜你喜欢
      • 2012-05-02
      • 1970-01-01
      • 2021-01-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多