zoukankan      html  css  js  c++  java
  • 动画和核心动画为基础的导航

    1 uiview动画
      
     [UIView beginAnimations:@"Curl"context:nil];//动画開始  
     [UIView setAnimationDuration:0.75]; 
     [UIView setAnimationDelegate:self]; 
     [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:view cache:YES];  
     [view removeFromSuperview]; 
     [UIView commitAnimations];

    2 CATransition层动画


    CATransition *animation = [CATransition animation]; [animation setDuration:1.25f];  
    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]]; 
     [animation setType:kCATransitionReveal]; 
    [animation setSubtype: kCATransitionFromBottom]; 
    [self.view.layer addAnimation:animation forKey:@"Reveal"]; 


    这里使用了setType与setSubtype组合,这使用个比較保险。由于他的參数就是官方API里定义的。他们的參数说明能够參考例如以下: 
      
    [animation setType:@"suckEffect"]; 
    这里的suckEffect就是效果名称。能够用的效果主要有: 
      pageCurl 向上翻一页   
     pageUnCurl 向下翻一页   
     rippleEffect 滴水效果  
     
     suckEffect 收缩效果。如一块布被抽走   
     cube 立方体效果   
     oglFlip 上下翻转效果


    3 核心动画

    http://blog.csdn.net/dztianyu/article/details/13776043


     foldLayer = [CATransformLayer layer]; foldLayer.anchorPoint = CGPointMake(1.0f, 0.5f); foldLayer.zPosition = 0foldLayer.frame = CGRectMake(0, 0, width/2, height);         [foldLayer addSublayer:currentLeftLayer]; [zheyeLayer addSublayer:foldLayer];                  CATransform3D endTransform = CATransform3DIdentity;  endTransform.m34 = 1.0f/2500.f;        endTransform = CATransform3DRotate(endTransform, cosA, 0.0, 1.0, 0.0);           foldLayer.transform = endTransform;

    版权声明:本文博客原创文章。博客,未经同意,不得转载。

  • 相关阅读:
    Redundant Paths 分离的路径(边双连通分量)
    bzoj2208 [Jsoi2010] 连通数(tarjan点双连通分量 // dfs)
    [bzoj3331] [BeiJing2013] 压力(tarjan 点双连通分量)
    [ BZOJ1123 ] BLO(tarjan点双连通分量)
    bitset小总结
    牛客328B Rabbit的工作(1)
    # Codeforces Round #529(Div.3)个人题解
    HDU5957 Query on a graph(拓扑找环,BFS序,线段树更新,分类讨论)
    istringstream()函数的用法
    codeforces 1077F1
  • 原文地址:https://www.cnblogs.com/zfyouxi/p/4622542.html
Copyright © 2011-2022 走看看