zoukankan      html  css  js  c++  java
  • iOS开发 差间距滚动

    CGFloat fView_Height(UIView *aView) {

      return aView.frame.size.height;

    }

    CGFloat fView_Width(UIView *aView) {

      return aView.frame.size.width;

    }

    // x方向的比例

    #define DX_Proportion [UIScreen mainScreen].bounds.size.width/(750/2.)

    // y方向的比例

    #define DY_Proportion  [UIScreen mainScreen].bounds.size.height/(1334/2.)

    - (void)scrollViewDidScroll:(UIScrollView *)scrollView {

      CGFloat offsetY = scrollView.contentOffset.y;

      if (scrollView == self.tableView) {

        if (offsetY <= self.originY) {

          CGFloat cha = self.originY - offsetY;

          CGFloat y = self.originY;

          y = self.originY - cha*0.5;

          self.imageScrollView.frame = CGRectMake(0, y, fView_Width(self.groundView), fView_Width(self.groundView));

        }

        else {

          CGFloat cha = offsetY - self.originY;

          CGFloat y = self.originY + cha*0.5;

          self.imageScrollView.frame = CGRectMake(0, y, fView_Width(self.groundView), fView_Width(self.groundView));

        }

      }

    }

  • 相关阅读:
    CentOS 7 安装MySQL 5.7
    Introduction to BGP (4)
    Introduction to BGP (3)
    Introduction to BGP (2)
    Introduction to BGP (1)
    Cisco NAT Fundation
    Linux安装Nginx
    GRE协议学习与练习
    Oracle Study Note : Users and Basic Security
    Oracle Study Note : Tablespace and Data Files
  • 原文地址:https://www.cnblogs.com/diweinan/p/6213994.html
Copyright © 2011-2022 走看看