zoukankan      html  css  js  c++  java
  • 算 保存吧,

    -(void)gesture

    {

        UISwipeGestureRecognizer * leftRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(segmentButtonClick:)];

        leftRecognizer.direction = UISwipeGestureRecognizerDirectionRight;

        leftRecognizer.cancelsTouchesInView = YES;

        

        UISwipeGestureRecognizer * rightRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(segmentButtonClick:)];

        rightRecognizer.direction = UISwipeGestureRecognizerDirectionLeft;

        

    //    [self.commonTableView addGestureRecognizer:leftRecognizer];

    //    [self.commonTableView addGestureRecognizer:rightRecognizer];

    }

     

    //

    -(IBAction)segmentButtonClick:(UISwipeGestureRecognizer *)gestureRecognizer

    {

        //100,作品列表 101,财账户,102,动信息

        if (currentSegment == 100 && gestureRecognizer.direction == UISwipeGestureRecognizerDirectionLeft) {

            self.headerView.frame = CGRectMake(storeHeaderViewframe.origin.x, storeHeaderViewframe.origin.y, storeHeaderViewframe.size.width, storeHeaderViewframe.size.height - 56);

            self.tableViewHeaderView.frame = self.headerView.frame;

            self.commonTableView.tableHeaderView = self.tableViewHeaderView;

            currentSegment = 101;

            tableViewResource = MONEYACCOUNT;

            UIButton *btn = [[UIButton alloc] init];

            btn.tag = currentSegment;

            [self.headerView buttonClick:btn];

            [self.commonTableViewreloadData];

            

            return;

        }else  if (currentSegment == 100 && gestureRecognizer.direction == UISwipeGestureRecognizerDirectionRight) {

            self.headerView.frame = storeHeaderViewframe;

            self.tableViewHeaderView.frame = self.headerView.frame;

            self.commonTableView.tableHeaderView = self.tableViewHeaderView;

            currentSegment = 102;

            tableViewResource = INTERACT;

            UIButton *btn = [[UIButton alloc] init];

            btn.tag = currentSegment;

            [self.headerView buttonClick:btn];

            [self.commonTableViewreloadData];

            return;

     

        }else  if (currentSegment == 101 && gestureRecognizer.direction == UISwipeGestureRecognizerDirectionLeft) {

            self.headerView.frame = storeHeaderViewframe;

            self.tableViewHeaderView.frame = self.headerView.frame;

            self.commonTableView.tableHeaderView = self.tableViewHeaderView;

            currentSegment = 102;

            tableViewResource = INTERACT;

            UIButton *btn = [[UIButton alloc] init];

            btn.tag = currentSegment;

            [self.headerView buttonClick:btn];

            [self.commonTableViewreloadData];

            return;

     

        }else  if (currentSegment == 101 && gestureRecognizer.direction == UISwipeGestureRecognizerDirectionRight) {

            self.headerView.frame = storeHeaderViewframe;

            self.tableViewHeaderView.frame = self.headerView.frame;

            self.commonTableView.tableHeaderView = self.tableViewHeaderView;

            currentSegment = 100;

            tableViewResource = WORKS;

            UIButton *btn = [[UIButton alloc] init];

            btn.tag = currentSegment;

            [self.headerView buttonClick:btn];

            [self.commonTableViewreloadData];

            return;

     

        }else  if (currentSegment == 102 && gestureRecognizer.direction == UISwipeGestureRecognizerDirectionLeft) {

            self.headerView.frame = storeHeaderViewframe;

            self.tableViewHeaderView.frame = self.headerView.frame;

            self.commonTableView.tableHeaderView = self.tableViewHeaderView;

            currentSegment = 100;

            tableViewResource = WORKS;

            UIButton *btn = [[UIButton alloc] init];

            btn.tag = currentSegment;

            [self.headerView buttonClick:btn];

            [self.commonTableViewreloadData];

            return;

     

        }else  if (currentSegment == 102 && gestureRecognizer.direction == UISwipeGestureRecognizerDirectionRight) {

            self.headerView.frame = CGRectMake(storeHeaderViewframe.origin.x, storeHeaderViewframe.origin.y, storeHeaderViewframe.size.width, storeHeaderViewframe.size.height - 56);//56  是指作品列表财账户两者换时 header差,这里写死里面了

            self.tableViewHeaderView.frame = self.headerView.frame;

            self.commonTableView.tableHeaderView = self.tableViewHeaderView;

            currentSegment = 101;

            tableViewResource = 1;

            UIButton *btn = [[UIButton alloc] init];

            btn.tag = currentSegment;

            [self.headerView buttonClick:btn];

            [self.commonTableViewreloadData];

            return;

     

        }

      

      }

  • 相关阅读:
    Spark数据读取
    05、TypeScript 中的泛型
    04、TypeScript 中的接口
    03、TypeScript 中的类
    02、TypeScript 中的函数
    01、TypeScript 数据类型
    Vue-router 知识点
    什么是跨域?如何解决跨域问题
    工作中积累的问题、知识点总结100题(0-20)
    封装一个 Promise 对象。了解其原理
  • 原文地址:https://www.cnblogs.com/guligei/p/3252391.html
Copyright © 2011-2022 走看看