IOS开发QQ空间/朋友圈类界面的搭建

2020-01-18 18:14:05王振洲

Controller界面就是把model放入cell里 

主要代码:


 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  RepairOrderTableViewCell *cell = [RepairOrderTableViewCell cellWithTableview:tableView];
  cell.currentIndexPath = indexPath;
  NSLog(@"改变前cell高度: %f",cell.statusFrame.cellHeight);
  [cell pushPhotoVC:^(NSArray *imageList) {
    //图片展示
    self.lookImageList = imageList;
    [self photoTap];
  }];
  [cell pushRealVC:^(NSString *frealname) {
    //跳转业主详情页
    OwnerViewController * ownerVC = [[OwnerViewController alloc]init];
    [self.navigationController pushViewController:ownerVC animated:YES];
  }];
  [cell lookReplyDetailView:^(NSIndexPath *myIndexPath,BOOL isOpen) {
    cell.statusFrame.isOpenReply = isOpen;
    [cell.statusFrame setModel:cell.statusFrame.model];
    NSLog(@"indexPath.row == %d",myIndexPath.row);
    //刷新这一行
    [tableView reloadRowsAtIndexPaths:@[myIndexPath] withRowAnimation:UITableViewRowAnimationNone];
    //    [tableView reloadData];
  }];
  [cell pushCommandViewController:^{
    //跳转去评论页面
    OrderCommandViewController * commandVC = [[OrderCommandViewController alloc]init];
    [self.navigationController pushViewController:commandVC animated:YES];
  }];
  cell.model = ((RepairOrderFrame *)self.framesArr[indexPath.row]).model;
  cell.statusFrame = self.framesArr[indexPath.row];
  return cell;
}

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持ASPKU。


注:相关教程知识阅读请移步到IOS开发频道。