zoukankan      html  css  js  c++  java
  • 底部导航上拉出现,下拉消失

    条件一:全局变量 CGFloat _scrollviewBeginSet;

        CGFloat _scrollviewDidSet;

     条件二:代理方法

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

        

        _scrollviewBeginSet = scrollView.contentOffset.y;

    }

    - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset {

        

        _scrollviewDidSet = 0;

        

    }

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

        

        if (_scrollviewDidSet == 0) {

            

            _scrollviewDidSet = scrollView.contentOffset.y;

            

            if (_scrollviewBeginSet < _scrollviewDidSet) {

                

                [UIView animateWithDuration:.25 animations:^{

                    barBgView.transform = CGAffineTransformMakeTranslation(0,barBgView.height);

                }];

                

               

                

            } else {

                

                [UIView animateWithDuration:.25 animations:^{

                    barBgView.transform = CGAffineTransformMakeTranslation(0,-barBgView.height);

                    

                }];

              

            }

        }

        

    }

    厚积薄发
  • 相关阅读:
    【HTML】html站标设置、网页小图标
    【idea】2020完整安装过程
    pptp,l2tp获取登录用户信息用pppd参数即可
    Postfix+Dovecot+MySQL搭建邮件服务器(续)
    Postfix+Dovecot+MySQL搭建邮件服务器
    zimage 和bzimage 有什么区别
    Linux编译内核
    8种nosql数据库对比
    core dump
    ulimit -c unlimited
  • 原文地址:https://www.cnblogs.com/yr434/p/4953669.html
Copyright © 2011-2022 走看看