// // THLanternScrollItemView.m // TreeHole // // Created by iOS on 2023/2/14. // Copyright © 2023 CYH. All rights reserved. // #import "THLanternScrollItemView.h" @interface THLanternScrollItemView () @property(nonatomic, strong)UIImageView *bgImgView; @property(nonatomic, strong)UIButton *lanternRightImgView_0; @property(nonatomic, strong)UIButton *lanternRightImgView_1; @property(nonatomic, strong)UIButton *lanternRightImgView_2; @property(nonatomic, strong)UIButton *lanternRightImgView_3; @property(nonatomic, strong)UIButton *lanternRightImgView_4; @property(nonatomic, strong)UIButton *lanternRightImgView_5; @property(nonatomic, strong)UIButton *lanternRightImgView_6; @property(nonatomic, strong)UIButton *lanternRightImgView_7; @property(nonatomic, strong)UIButton *lanternRightImgView_8; @property(nonatomic, strong)UIButton *lanternRightImgView_9; @property(nonatomic, strong)UIButton *lanternLeftImgView_0; @property(nonatomic, strong)UIButton *lanternLeftImgView_1; @property(nonatomic, strong)UIButton *lanternLeftImgView_2; @property(nonatomic, strong)UIButton *lanternLeftImgView_3; @property(nonatomic, strong)UIButton *lanternLeftImgView_4; @property(nonatomic, strong)UIButton *lanternLeftImgView_5; @property(nonatomic, strong)UIButton *lanternLeftImgView_6; @property(nonatomic, strong)UIButton *lanternLeftImgView_7; @end @implementation THLanternScrollItemView - (void)setItemTapBlock:(void (^)(UIControl *))itemTapBlock { _itemTapBlock = itemTapBlock; _lanternRightImgView_0.qmui_tapBlock = itemTapBlock; _lanternRightImgView_1.qmui_tapBlock = itemTapBlock; _lanternRightImgView_2.qmui_tapBlock = itemTapBlock; _lanternRightImgView_3.qmui_tapBlock = itemTapBlock; _lanternRightImgView_4.qmui_tapBlock = itemTapBlock; _lanternRightImgView_5.qmui_tapBlock = itemTapBlock; _lanternRightImgView_6.qmui_tapBlock = itemTapBlock; _lanternRightImgView_7.qmui_tapBlock = itemTapBlock; _lanternRightImgView_8.qmui_tapBlock = itemTapBlock; _lanternRightImgView_9.qmui_tapBlock = itemTapBlock; _lanternLeftImgView_0.qmui_tapBlock = itemTapBlock; _lanternLeftImgView_1.qmui_tapBlock = itemTapBlock; _lanternLeftImgView_2.qmui_tapBlock = itemTapBlock; _lanternLeftImgView_3.qmui_tapBlock = itemTapBlock; _lanternLeftImgView_4.qmui_tapBlock = itemTapBlock; _lanternLeftImgView_5.qmui_tapBlock = itemTapBlock; _lanternLeftImgView_6.qmui_tapBlock = itemTapBlock; _lanternLeftImgView_7.qmui_tapBlock = itemTapBlock; } - (void)setupSubViews { // self.qmui_shouldShowDebugColor = YES; _bgImgView = [UIImageView creatImageViewWithImageName:@"TH_Lantern_bg" inSuperView:self]; _lanternRightImgView_0 = [UIButton creatButtonWithImageName:@"TH_lantern_right" state:UIControlStateNormal inSuperView:self]; _lanternRightImgView_1 = [UIButton creatButtonWithImageName:@"TH_lantern_right" state:UIControlStateNormal inSuperView:self]; _lanternRightImgView_2 = [UIButton creatButtonWithImageName:@"TH_lantern_right" state:UIControlStateNormal inSuperView:self]; _lanternRightImgView_3 = [UIButton creatButtonWithImageName:@"TH_lantern_right" state:UIControlStateNormal inSuperView:self]; _lanternRightImgView_4 = [UIButton creatButtonWithImageName:@"TH_lantern_right" state:UIControlStateNormal inSuperView:self]; _lanternRightImgView_5 = [UIButton creatButtonWithImageName:@"TH_lantern_right" state:UIControlStateNormal inSuperView:self]; _lanternRightImgView_6 = [UIButton creatButtonWithImageName:@"TH_lantern_right" state:UIControlStateNormal inSuperView:self]; _lanternRightImgView_7 = [UIButton creatButtonWithImageName:@"TH_lantern_right" state:UIControlStateNormal inSuperView:self]; _lanternRightImgView_8 = [UIButton creatButtonWithImageName:@"TH_lantern_right" state:UIControlStateNormal inSuperView:self]; _lanternRightImgView_9 = [UIButton creatButtonWithImageName:@"TH_lantern_right" state:UIControlStateNormal inSuperView:self]; _lanternLeftImgView_0 = [UIButton creatButtonWithImageName:@"TH_lantern_left" state:UIControlStateNormal inSuperView:self]; _lanternLeftImgView_1 = [UIButton creatButtonWithImageName:@"TH_lantern_left" state:UIControlStateNormal inSuperView:self]; _lanternLeftImgView_2 = [UIButton creatButtonWithImageName:@"TH_lantern_left" state:UIControlStateNormal inSuperView:self]; _lanternLeftImgView_3 = [UIButton creatButtonWithImageName:@"TH_lantern_left" state:UIControlStateNormal inSuperView:self]; _lanternLeftImgView_4 = [UIButton creatButtonWithImageName:@"TH_lantern_left" state:UIControlStateNormal inSuperView:self]; _lanternLeftImgView_5 = [UIButton creatButtonWithImageName:@"TH_lantern_left" state:UIControlStateNormal inSuperView:self]; _lanternLeftImgView_6 = [UIButton creatButtonWithImageName:@"TH_lantern_left" state:UIControlStateNormal inSuperView:self]; _lanternLeftImgView_7 = [UIButton creatButtonWithImageName:@"TH_lantern_left" state:UIControlStateNormal inSuperView:self]; } - (void)layoutSubviews { [super layoutSubviews]; self.bgImgView.frame = self.bounds; self.lanternRightImgView_0.frame = CGRectMake(W_Scale(62), W_Scale(40), W_Scale(93), W_Scale(101)); self.lanternRightImgView_1.frame = CGRectMake(W_Scale(94), W_Scale(172), W_Scale(85), W_Scale(101)); self.lanternRightImgView_2.frame = CGRectMake(W_Scale(249), W_Scale(269), W_Scale(91), W_Scale(100)); self.lanternRightImgView_3.frame = CGRectMake(W_Scale(150), W_Scale(694), W_Scale(83), W_Scale(96)); self.lanternRightImgView_4.frame = CGRectMake(W_Scale(62), W_Scale(860), W_Scale(93), W_Scale(101)); self.lanternRightImgView_5.frame = CGRectMake(W_Scale(155), W_Scale(961), W_Scale(85), W_Scale(101)); self.lanternRightImgView_6.frame = CGRectMake(W_Scale(220), W_Scale(1095), W_Scale(91), W_Scale(100)); self.lanternRightImgView_7.frame = CGRectMake(W_Scale(267), W_Scale(1250), W_Scale(84), W_Scale(97)); self.lanternRightImgView_8.frame = CGRectMake(W_Scale(267), W_Scale(1250), W_Scale(85), W_Scale(97)); self.lanternRightImgView_9.frame = CGRectMake(W_Scale(176), W_Scale(1338), W_Scale(93), W_Scale(101)); self.lanternLeftImgView_0.frame = CGRectMake(W_Scale(257), W_Scale(143), W_Scale(61), W_Scale(80)); self.lanternLeftImgView_1.frame = CGRectMake(W_Scale(50), W_Scale(270), W_Scale(61), W_Scale(81)); self.lanternLeftImgView_2.frame = CGRectMake(W_Scale(162), W_Scale(405), W_Scale(61), W_Scale(80)); self.lanternLeftImgView_3.frame = CGRectMake(W_Scale(301), W_Scale(519), W_Scale(61), W_Scale(81)); self.lanternLeftImgView_4.frame = CGRectMake(W_Scale(257), W_Scale(855), W_Scale(61), W_Scale(80)); self.lanternLeftImgView_5.frame = CGRectMake(W_Scale(50), W_Scale(1059), W_Scale(61), W_Scale(80)); self.lanternLeftImgView_6.frame = CGRectMake(W_Scale(59), W_Scale(1229), W_Scale(61), W_Scale(80)); self.lanternLeftImgView_7.frame = CGRectMake(W_Scale(125), W_Scale(1474), W_Scale(61), W_Scale(80)); } @end