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{//动画开始之后
    }
  • 相关阅读:
    数据分析1-2
    数据分析1-1
    数据分析案例:
    数据分析1:安装tushare安装包
    小爬爬7:回顾&&crawlSpider
    小爬爬6: 网易新闻scrapy+selenium的爬取
    小爬爬6:中间件
    小爬爬6:2请求传参
    前端 -----jQuery的选择器
    前端 ----jQuery的介绍
  • 原文地址:https://www.cnblogs.com/cnsec/p/11515884.html
Copyright © 2011-2022 走看看