zoukankan      html  css  js  c++  java
  • iOS图标抖动效果

    开始抖动

    -(void)BeginWobble
    {
    
        srand([[NSDate date] timeIntervalSince1970]);
        float rand=(float)random();
        CFTimeInterval t=rand*0.0000000001;
    
        [UIView animateWithDuration:0.1 delay:t options:0  animations:^
         {
             要抖动的视图.transform=CGAffineTransformMakeRotation(-0.05);
         } completion:^(BOOL finished)
         {
             [UIView animateWithDuration:0.1 delay:0 options:UIViewAnimationOptionRepeat|UIViewAnimationOptionAutoreverse|UIViewAnimationOptionAllowUserInteraction  animations:^
              {
                  要抖动的视图.transform=CGAffineTransformMakeRotation(0.05);
              } completion:^(BOOL finished) {}];
         }];
    }

    停止抖动

    -(void)EndWobble
    {
    
        [UIView animateWithDuration:0.1 delay:0 options:UIViewAnimationOptionAllowUserInteraction|UIViewAnimationOptionBeginFromCurrentState animations:^
         {
             要抖动的视图.transform=CGAffineTransformIdentity;
         } completion:^(BOOL finished) {}];
    }
     
  • 相关阅读:
    工具类-vim在shell中卡死的情况
    tomcat日志分类
    逻辑运算
    牛客练习赛29 F 算式子
    牛客练习赛29 B
    查询
    hdu 5984
    zoj 4057
    zoj 4056
    zoj 4054
  • 原文地址:https://www.cnblogs.com/wanghuaijun/p/5223316.html
Copyright © 2011-2022 走看看