zoukankan      html  css  js  c++  java
  • UIView的动画效果

    在进行页面切换的时候,对于在视图上添加一部分动画效果的话,使页面的切换更加柔和,提升用户体验。

    uiview 的各种动画 的动画效果 常见的有几种方式

    第一种:有对应的旋转效果的
    [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDuration:0.6];
        [UIView transitionWithView:imgView duration:0.6   // 在noteView视图上设置过渡效果 是个枚举类型
                                 options:UIViewAnimationOptionTransitionNone
                              animations:^{
                                  imgView.alpha = 0;
                                   }
                              completion:^(BOOL finished){
                                  [imgView removeFromSuperview];
                                  }];
        [UIView commitAnimations];
    beginAnimations 开始动画
    setAnimationDuration 持续时间
    transitionWithView:变动的视图  duration:持续时间 options:动画的效果 animations:^{需要操作的内容} completion:^(bool finished){动画完成后执行的内容}
    commitAnimations结束动画

    第二种:没有效果的动画
    [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDuration:0.6];
        [UIView  animationWithDuration:0.6   // 在noteView视图上设置过渡效果
                                 options:UIViewAnimationOptionTransitionNone
                              animations:^{
                                  imgView.alpha = 0;
                                   }
                              completion:^(BOOL finished){
                                  [imgView removeFromSuperview];
                                  }];
        [UIView commitAnimations];

     
  • 相关阅读:
    关于gtk的GCond
    位运算符及其应用
    登陆新浪微博&批量下载收藏内容[Python脚本实现]
    海量数据处理算法—Bloom Filter
    海量数据处理算法—BitMap
    VB.NET机房收费系统——组合查询
    非官方的gstreamer学习资料及概念摘要
    [Python入门及进阶笔记00]写在前面(目录/书籍/学习路线/其他)
    [JAVA][Eclipse]JVM terminated. Exit code=13
    介绍一个android开源文件选择对话框:androidfiledialog
  • 原文地址:https://www.cnblogs.com/gepf/p/4929289.html
Copyright © 2011-2022 走看看