zoukankan      html  css  js  c++  java
  • where amazing happens

    - (void)didSelectCellRowFirstDo:(BOOL)firstDoInsert nextDo:(BOOL)nextDoInsert

    {

        self.isOpen = firstDoInsert;

        

        FlightListCell *cell1 = (FlightListCell *)[self.expansionTableViewcellForRowAtIndexPath:self.selectIndex];

        if (self.isOpen) {

            cell1.flightBottomLineImageView.hidden = YES;

            

        }else{

            cell1.flightBottomLineImageView.hidden = NO;

        }

       

        //FlightListCell *cell = (FlightListCell *)[self.expansionTableView cellForRowAtIndexPath:self.selectIndex];

        [self.expansionTableViewbeginUpdates];

        

        int section = self.selectIndex.section;

         HFFlight *flight  = (HFFlight *)[self.fListArray objectAtIndex:section];

        if (firstDoInsert && !nextDoInsert) {

            

            

            if (flight.tempCabins) {// 缓存中加载数据

                flight.cabins = flight.tempCabins;

                [self.expansionTableViewreloadData];

     

            }else{

                [self loadCabins:flight];

     

            }

        }

       

        int contentCount = flight.cabins.count;

    NSMutableArray* rowToInsert = [[NSMutableArrayalloc] init];

    for (NSUInteger i = 1; i < contentCount + 1; i++) {

    NSIndexPath* indexPathToInsert = [NSIndexPath indexPathForRow:i inSection:section];

    [rowToInsert addObject:indexPathToInsert];

    }

     

    if (firstDoInsert)

            

        {

                  [self.expansionTableViewinsertRowsAtIndexPaths:rowToInsert withRowAnimation:UITableViewRowAnimationTop];

        }

    else

        {

            [self.expansionTableViewdeleteRowsAtIndexPaths:rowToInsert withRowAnimation:UITableViewRowAnimationTop];

        }

        

    [self.expansionTableViewendUpdates];

        if (nextDoInsert) {

            self.isOpen = YES;

            self.selectIndex = currentIndexPath;

     

           // self.selectIndex = [self.expansionTableView indexPathForSelectedRow];

            [selfdidSelectCellRowFirstDo:YESnextDo:NO];

        }

        if (self.isOpen) {

            [self.expansionTableViewscrollToRowAtIndexPath:currentIndexPathatScrollPosition:UITableViewScrollPositionTopanimated:YES];

           // [self.expansionTableView scrollsToTop];

        }

        //if (self.isOpen) [self.expansionTableView scrollToNearestSelectedRowAtScrollPosition:UITableViewScrollPositionTop animated:YES];

    }

  • 相关阅读:
    C#中 ()=>的含义
    大白话系列之C#委托与事件讲解(三)
    大白话系列之C#委托与事件讲解(二)
    C#委托
    php.ini
    mac 登陆phpmyadmin 提示 mysqli_real_connect(): (HY000/2002): No such file or directory
    mac 安装 mysql 5.7
    Mac下的PHP的配置与运行
    phpstorm 2019.1 mac
    激活 phpstorm2019.1 win10
  • 原文地址:https://www.cnblogs.com/guligei/p/3095359.html
Copyright © 2011-2022 走看看