UITableView展开合上的动画。

右边那个那个图片会从左边飞过来,,,如果用自定义cell就不会了。。。。

 

-(void)tapAction:(id)sender{

    UIButton *tempBtn = (UIButton *)sender;

   self.openString = [NSString stringWithFormat:@"%d",tempBtn.tag];

    

    if ([self.openArraycontainsObject:self.openString]) {

        [self.openArrayremoveObject:self.openString];

    }else{

        [self.openArrayaddObject:self.openString];

    }

  [self.tableViewreloadSections:[NSIndexSetindexSetWithIndex:tempBtn.tag] withRowAnimation:UITableViewRowAnimationFade];

上面不放在下面的动画块里面就行了。。。。否则section,的title 会有一个闪的效果很不好。

   /// [UIViewanimateWithDuration:0.2fanimations:^{

       [self.tableViewreloadSections:[NSIndexSetindexSetWithIndex:tempBtn.tag] withRowAnimation:UITableViewRowAnimationFade];

    } completion:^(BOOL finished) {

        

    }];

    

    

 

}

猜你喜欢

转载自zhangmingwei.iteye.com/blog/2036861
今日推荐