| | |
| | | UIButton *buttonRecord = [[UIButton alloc] init]; |
| | | [buttonRecord setImage:[UIImage imageNamed:@"home_record"] forState:UIControlStateNormal]; |
| | | [self addSubview:buttonRecord]; |
| | | buttonRecord.sd_layout.rightSpaceToView(self, 21).centerYEqualToView(_viewNav).widthIs(23).heightIs(23); |
| | | buttonRecord.sd_layout.rightSpaceToView(self, 51).centerYEqualToView(_viewNav).widthIs(23).heightIs(23); |
| | | [buttonRecord addTarget:self action:@selector(onViewRecord) forControlEvents:UIControlEventTouchUpInside]; |
| | | |
| | | //分类 |
| | | UIButton *buttonCategory = [[UIButton alloc] init]; |
| | | [buttonCategory setImage:[UIImage imageNamed:@"home_category"] forState:UIControlStateNormal]; |
| | | [self addSubview:buttonCategory]; |
| | | buttonCategory.sd_layout.rightSpaceToView(self, 10).centerYEqualToView(buttonRecord).widthIs(23).heightIs(23); |
| | | [buttonCategory addTarget:self action:@selector(onViewCategory) forControlEvents:UIControlEventTouchUpInside]; |
| | | |
| | | |
| | | |
| | | [self.viewNav addSubview:self.viewSearch]; |
| | | self.viewSearch.sd_layout.leftSpaceToView(self.viewNav, 11).centerYEqualToView(self.viewNav).rightSpaceToView(buttonRecord, 21).heightIs(34); |
| | |
| | | !self.onRecord?:self.onRecord(); |
| | | } |
| | | |
| | | - (void)onViewCategory { |
| | | !self.onCategory?:self.onCategory(); |
| | | } |
| | | |
| | | - (void)touchSearch { |
| | | !self.onSearch?:self.onSearch(); |
| | | } |