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

     
  • 相关阅读:
    P2216-[HAOI2007]理想的正方形
    P2157-[SDOI2009]学校食堂
    Leetcode-5176 Number of Valid Words for Each Puzzle(猜字谜)
    Leetcode-5175 Can Make Palindrome from Substring(构建回文串检测)
    Leetcode-5174 Diet Plan Performance(健身计划评估)
    Task6.PyTorch理解更多神经网络优化方法
    Task5.PyTorch实现L1,L2正则化以及Dropout
    Task4.用PyTorch实现多层网络
    Task3.PyTorch实现Logistic regression
    Task2.设立计算图并自动计算
  • 原文地址:https://www.cnblogs.com/gepf/p/4929289.html
Copyright © 2011-2022 走看看