用户登录
用户注册

分享至

iOS 类似陌陌,网易,path个人属性界面的动画效果 -- 滑动scrollview时,随距离改变属性的动画原理!

  • 作者: 选择75222135
  • 来源: 51数据库
  • 2022-08-17
#define offsety scrollView.contentOffset.y  
#define endoffsety 153.0f  
  
-(void)scrollViewDidScroll:(UIScrollView *)scrollView  
{  
    if (scrollView.tag == 1001) {  
        if ((offsety > 0)&&(offsety<153)) {  
         //更加距离变化计算,改变属性的方法  
            [self AnnimationWithProperty:offsety];  
        }  
        else if (offsety < 0){  
         //更加距离变化计算,改变属性的方法  
            [self AnnimationWithProperty:0];  
        }  
        else if ((offsety> 153)&&(_frontView.top > -153)) {  
         //更加距离变化计算,改变属性的方法  
            [self AnnimationWithProperty:endoffsety];  
        }  
    }  
}  
软件
前端设计
程序设计
Java相关