zoukankan      html  css  js  c++  java
  • 制作渐渐消失的弹框提示

    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(50, 100, 200, 30)];
        
        [UIView beginAnimations:@"View Flip" context:nil];
        [UIView setAnimationDuration:2.25];
        [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
        [UIView setAnimationDelegate:self];//一定要设置动画的委托

        view.backgroundColor = [UIColor blackColor];
        view.alpha = 0.0;
        view.layer.cornerRadius = 3;
        [self.view addSubview:view];
    //[view setFrame:CGRectMake(50, 150, 200, 30)]; 通过修这个view的位置可以实现滑动效果
        [view release];
        
        [UIView commitAnimations];

    然后实现动画的开始或结束的回调函数
    -(void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{//当动画结束之后的回调函数,如可删除先前弹出的那个view框  避免view一直留在父view中
        NSLog(@"%@",anim.description);//值为View Flip
        if (flag) {
            NSLog(@"dfsdd");
        }
    }
    -(void)animationDidStart:(CAAnimation *)anim{//动画开始之后
    }
  • 相关阅读:
    【leetcode】1030. Matrix Cells in Distance Order
    【leetcode】1031. Maximum Sum of Two Non-Overlapping Subarrays
    【leetcode】1032. Stream of Characters
    L120 单词造句
    L119
    L118
    2018.8.6邮件规范一
    L117
    L116
    L115
  • 原文地址:https://www.cnblogs.com/cnsec/p/11515884.html
Copyright © 2011-2022 走看看