| | |
| | | } else { |
| | | labelNumber.backgroundColor = UICOLOR_FROM_RGB(0xC2C2C2, 1); |
| | | } |
| | | labelNumber.sd_layout.leftSpaceToView(viewBG, 16).topSpaceToView(viewBG, 49 + 17 * j + 11 * j).widthIs(17).heightIs(17); |
| | | |
| | | UILabel *labelName = [[UILabel alloc] init]; |
| | | labelName.text = name; |
| | |
| | | labelName.textColor = [UIColor blackColor]; |
| | | labelName.font = [UIFont boldSystemFontOfSize:12]; |
| | | [viewBG addSubview:labelName]; |
| | | |
| | | UIButton *buttonTap = [UIButton buttonWithType:UIButtonTypeCustom]; |
| | | buttonTap.titleLabel.text = name; |
| | | [viewBG addSubview:buttonTap]; |
| | | |
| | | if (j > 4) { |
| | | labelNumber.sd_layout.leftSpaceToView(viewBG, 152).topSpaceToView(viewBG, 49 + 17 * (j - 5) + 11 * (j - 5)).widthIs(17).heightIs(17); |
| | | labelName.sd_layout.leftSpaceToView(labelNumber, 13).centerYEqualToView(labelNumber).widthIs(90).heightIs(17); |
| | | |
| | | buttonTap.sd_layout.leftSpaceToView(viewBG, 152).topSpaceToView(viewBG, 49 + 17 * (j - 5) + 11 * (j - 5)).widthIs(120).heightIs(17); |
| | | |
| | | } else { |
| | | labelNumber.sd_layout.leftSpaceToView(viewBG, 16).topSpaceToView(viewBG, 49 + 17 * j + 11 * j).widthIs(17).heightIs(17); |
| | | labelName.sd_layout.leftSpaceToView(labelNumber, 13).centerYEqualToView(labelNumber).widthIs(100).heightIs(17); |
| | | |
| | | buttonTap.sd_layout.leftSpaceToView(viewBG, 16).topSpaceToView(viewBG, 49 + 17 * j + 11 * j).widthIs(130).heightIs(17); |
| | | } |
| | | labelNumber.sd_cornerRadius = @4; |
| | | |
| | | [buttonTap addTarget:self action:@selector(touchTitle:) forControlEvents:UIControlEventTouchUpInside]; |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | - (void)touchTitle:(UIButton *)button { |
| | | NSString *title = button.titleLabel.text; |
| | | if (_delegate && [_delegate respondsToSelector:@selector(hotSearchEvent:)]) { |
| | | [_delegate hotSearchEvent:title]; |
| | | } |
| | | } |
| | | |
| | | - (UIScrollView *)scrollView { |
| | | if (!_scrollView) { |
| | | _scrollView = [[UIScrollView alloc] init]; |