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];

     
  • 相关阅读:
    xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!
    xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!
    xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!
    xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!
    只需这10步,通过历史控制文件恢复数据库
    直播丨Oracle 12.2系列安装
    Python爬虫入门教程 70-100 爬虫原理应用到多种场景,Python下载B站视频
    windows python2.7 安装pyqt5
    Activiti任务参数的设置方式和作用域
    python 多线程2
  • 原文地址:https://www.cnblogs.com/gepf/p/4929289.html
Copyright © 2011-2022 走看看