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

    }

  • 相关阅读:
    JSP第七次作业
    JSP第六次作业
    Jsp第五次作业
    软件测试第二次作业
    Jsp第四次作业2
    Jsp第四次作业1
    软件测试第一次作业
    JSP第三次作业
    JSP第二次作业
    第七次作业
  • 原文地址:https://www.cnblogs.com/guligei/p/3095359.html
Copyright © 2011-2022 走看看