1234567891011121314151617181920212223242526272829303132333435363738 |
- //
- // KBHeaderReusableView.m
- // YouHuiProject
- //
- // Created by 小花 on 2018/1/18.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "KBHeaderReusableView.h"
- @interface KBHeaderReusableView ()<YHTypeButtonActionDelegate>
- @property (nonatomic, strong) KBTypeButtonHeader *selctionHeader;
- @end
- @implementation KBHeaderReusableView
- - (instancetype)initWithFrame:(CGRect)frame {
- self = [super initWithFrame:frame];
- if (self)
- {
- self.selctionHeader = [[KBTypeButtonHeader 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
|