admin
2023-04-21 0b3a4aaf99ea251bc8e27b96115288f0988fcffe
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
74
75
76
//
//  CellOne.m
//  BuWanVideo2.0
//
//  Created by weikou2016 on 16/8/9.
//  Copyright © 2016年 com.yeshi.buwansheque.ios. All rights reserved.
//
 
#import "CellOne.h"
#import "AllSpecialController.h"
 
@implementation CellOne
 
- (void)awakeFromNib {
    [super awakeFromNib];
    [self initScene];
}
 
-(void)initScene{
    self.backgroundColor = kGlobalBackgroundColor;
    
    UIView *backgroundView= [[UIView alloc] initWithFrame:CGRectMake(0, [CellOne getsdcheight], KScreenW, 27)];
    backgroundView.backgroundColor = [UIColor whiteColor];
    [self addSubview:backgroundView];
    
    //视图上的小件   168  54
    UIImageView * imagehuang = [[UIImageView alloc]initWithFrame:CGRectMake(KScreenW - 84, 0, 84, 27)];
    imagehuang.image = [UIImage imageNamed:@"更多专题.png"];
    [backgroundView addSubview:imagehuang];
    
    UILabel * textLabel = [[UILabel alloc]initWithFrame:CGRectMake(KScreenW - 55, 0, 50, 27)];
    textLabel.font = [UIFont systemFontOfSize:12];
    textLabel.text = @"更多专题";
    [backgroundView addSubview:textLabel];
    
    _lable = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, KScreenW - 90, 27)];
    _lable.font = [UIFont systemFontOfSize:15];
    _lable.text = @"";
    _lable.textColor = [UIColor blackColor];
    [backgroundView addSubview:_lable];
    
    UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(Clicklable:)];
    backgroundView.userInteractionEnabled = YES;
    [backgroundView addGestureRecognizer:tap];
}
 
//更多专题
-(void)Clicklable:(id)sender{
    AllSpecialController * allcontroller  = [AllSpecialController new];
    [allcontroller setHidesBottomBarWhenPushed:YES];
    [[self viewController].navigationController pushViewController:allcontroller animated:YES];
}
 
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}
 
+(float)getsdcheight{
    return  KScreenW*7 /16;
}
 
+(float)getHeight{
    return  KScreenW*7 /16 + 27;
}
 
- (UIViewController *)viewController {
    for (UIView* next = [self superview]; next; next = next.superview) {
        UIResponder *nextResponder = [next nextResponder];
        if ([nextResponder isKindOfClass:[UIViewController class]]) {
            return (UIViewController *)nextResponder;
        }
    }
    return nil;
}
 
@end