1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//
// KWMLastView.m
// iCemarose
//
// Created by 陈荣科 on 16/8/25.
// Copyright © 2016年 kollway. All rights reserved.
//
#import "KWMLastView.h"
@implementation KWMLastView
- (void)awakeFromNib{
self.btnEnter.layer.borderWidth = 1;
self.btnEnter.layer.borderColor = [UIColor blackColor].CGColor;
}
- (void)layoutSubviews{
CGFloat logoY = UI_SCREEN_HEITHT*0.2279f;
CGFloat logoW = UI_SCREEN_WIDTH*0.4f;
CGFloat logoH = UI_SCREEN_HEITHT*0.0404f;
self.logoTop.constant = logoY;
self.logoWidth.constant = logoW;
self.logoHeight.constant = logoH;
CGFloat enterY = UI_SCREEN_HEITHT*0.8065f;
CGFloat enterW = UI_SCREEN_WIDTH*0.2453f;
CGFloat enterH = UI_SCREEN_HEITHT*0.0420f;
self.enterTop.constant = enterY;
self.enterWidth.constant = enterW;
self.enterHeight.constant = enterH;
}
- (void)animating{
CABasicAnimation *textAnimation = [self getShowAnimation];
[self.lbText.layer addAnimation:textAnimation forKey:@"textAnimation"];
}
- (CABasicAnimation *)getShowAnimation{
CABasicAnimation *enterAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"];
enterAnimation.duration = 3.0f;
enterAnimation.repeatCount = 1;
enterAnimation.delegate = self;
enterAnimation.fromValue = [NSNumber numberWithDouble:0.0f];
enterAnimation.toValue = [NSNumber numberWithDouble:1.0f];
enterAnimation.autoreverses = NO;
enterAnimation.removedOnCompletion = NO;
return enterAnimation;
}
- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{
if([self.btnEnter.layer animationForKey:@"enterAnimation" ] == anim){
self.btnEnter.alpha = 1.0;
[self.btnEnter.layer removeAllAnimations];
}else{
self.lbText.alpha = 1.0;
[self.lbText.layer removeAllAnimations];
CABasicAnimation *enterAnimation = [self getShowAnimation];
[self.btnEnter.layer addAnimation:enterAnimation forKey:@"enterAnimation"];
}
}
//点击进入按钮
- (IBAction)onClickEnterBtn:(id)sender {
if (self.delegate != nil) {
[self.delegate kwm_enter];
}
NSLog(@"点击了进入按钮");
}
@end