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];

    }

  • 相关阅读:
    转载---JVM四种引用--用于记录知识
    Ionic的安装、创建、及一些记录
    Angular响应式表单--附上完整代码演示
    Angular自定义模块—使用路由实现懒加载--及错误解决
    Angular自定义模块(普通)
    Angula获取服务器数据
    Angular同步与异步获取服务数据(附完整代码)
    Angular父子组件的方法传递以及数据传递
    logrotate
    Capistrano 3
  • 原文地址:https://www.cnblogs.com/guligei/p/3095359.html
Copyright © 2011-2022 走看看