zoukankan      html  css  js  c++  java
  • IOS 制作动画代码和 设置控件透明度

    方式1:

      //animateWithDuration用1秒钟的时间,执行代码
        [UIView animateWithDuration:1.0 animations:^{
          
            //存放需要执行的动画代码
            self.iconBtn.frame=CGRectMake(83,85,150,150);
            self.cover.alpha=0.0;//设置控件的透明度
        } completion:^(BOOL finished) {
            //动画执行完毕后会自动调用这个block内部的代码
            [self.cover removeFromSuperview];
            self.cover=nil;
        }];

    方式2:

      //执行动画代码
       [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDuration:1.0];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationDidStopSelector:@selector(removerCover)];
        
        
        self.iconBtn.frame=CGRectMake(85, 85,150,  150);
        self.cover.alpha=0.0;
        [UIView commitAnimations];
        
        
    }
    
    -(void)removerCover
    {
            [self.cover removeFromSuperview];
            self.cover=nil;
    }
  • 相关阅读:
    mysql 统计数据库基本资源sql
    java ffmpeg (Linux)截取视频做封面
    shutil模块
    json模块与pickle模块
    hashlib模块
    sys模块
    os模块
    paramiko模块
    Python reduce() 函数
    瀑布流展示图片
  • 原文地址:https://www.cnblogs.com/liuwj/p/6418421.html
Copyright © 2011-2022 走看看