// // LDHeaderReusableView.m // YouHuiProject // // Created by 小花 on 2018/1/18. // Copyright © 2018年 kuxuan. All rights reserved. // #import "LDHeaderReusableView.h" @interface LDHeaderReusableView () @property (nonatomic, strong) LDTypeButtonHeader *selctionHeader; @end @implementation LDHeaderReusableView - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.selctionHeader = [[LDTypeButtonHeader alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 40)]; self.selctionHeader.backgroundColor = [UIColor whiteColor]; [self.selctionHeader setTypeButtonTitles:@[@"推荐",@"最新",@"销量"] withDownLableHeight:0 andDeleagte:self]; [self.selctionHeader setTypeButtonNormalColor:[UIColor YHColorWithHex:0x666666] andSelectColor:[UIColor YHColorWithHex:0xff2420]]; [self addSubview:self.selctionHeader]; } return self; } #pragma mark ----------- - (void)didClickTypeButtonAction:(UIButton *)button withIndex:(NSInteger)index { if (self.delegate && [self.delegate respondsToSelector:@selector(YHTypeReusableViewDidSelectedIndex:)]) { [self.delegate YHTypeReusableViewDidSelectedIndex:index]; } } @end