//创建一个UIimageView
UIImage *image1 = [UIImage imageNamed:@"weixin.png"];
self.imageView1 = [[UIImageView alloc] initWithImage:image1];
[self.window addSubview:self.imageView1];
//设置一个倒计时间
self.secondsCountDown = 3.0;//3秒倒计时
//创建一个NSTimer计时器
self.countDownTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(timeFireMethod) userInfo:nil repeats:YES];
-(void)timeFireMethod{
self.secondsCountDown--;
if(self.secondsCountDown == 0){
//如果计时结束countDownTimer被无效
[self.countDownTimer invalidate];
//imageView1透明度设置为0
self.imageView1.alpha = 0.0;
}
UIImage *image1 = [UIImage imageNamed:@"weixin.png"];
self.imageView1 = [[UIImageView alloc] initWithImage:image1];
[self.window addSubview:self.imageView1];
//设置一个倒计时间
self.secondsCountDown = 3.0;//3秒倒计时
//创建一个NSTimer计时器
self.countDownTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(timeFireMethod) userInfo:nil repeats:YES];
-(void)timeFireMethod{
self.secondsCountDown--;
if(self.secondsCountDown == 0){
//如果计时结束countDownTimer被无效
[self.countDownTimer invalidate];
//imageView1透明度设置为0
self.imageView1.alpha = 0.0;
}
}