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

     
  • 相关阅读:
    arduino编程基础之--程序 元素
    arduino编程基础之--环境搭建
    C语言高手之路--目录
    生活中的数据结构
    Manjaro-KDE配置全攻略转
    多线程程序的奇怪问题记录
    manjaro安装openmv ide
    Linux进程数据结构详解
    Linux ps aux指令詳解--转
    记一次粗心大意的代码错误
  • 原文地址:https://www.cnblogs.com/gepf/p/4929289.html
Copyright © 2011-2022 走看看