簡(jiǎn)單的標(biāo)簽頁面木张,提供選中和取消選中众辨。可實(shí)現(xiàn)多行舷礼,一行多少個(gè)都可自定義鹃彻。已暴露出以下屬性可供自定義,妻献。demo地址
簡(jiǎn)單的實(shí)現(xiàn)方法:
mSelectedArr = [NSMutableArray array];
? ? mDataSource = [NSMutableArray arrayWithObjects:@"社科",@"認(rèn)知智慧節(jié)目",@"文學(xué)",@"文化藝術(shù)",@"科技",@"科學(xué)",@"兩性",@"家庭",@"親子",@"健康",@"生活方式",@"溝通",@"創(chuàng)業(yè)",@"互聯(lián)網(wǎng)",@"金融",@"財(cái)富",@"職場(chǎng)",@"管理",@"商業(yè)",@"經(jīng)濟(jì)學(xué)",@"思維",@"心理學(xué)",@"歷史",@"趨勢(shì)",@"自我管理",@"方法技能",@"學(xué)科通識(shí)", nil];
? ? mTagView = [[ScrollTagView alloc]initWithFrame:CGRectMake(0, 64, SCREENWIDTH, SCREENHEIGHT)];
? ? mTagView.showWidht = SCREENWIDTH;
? ? mTagView.totalCols = 4;
? ? mTagView.labTextFont = 12;
? ? mTagView.spaceLeft = 10;
? ? mTagView.spaceRight = 10;
? ? mTagView.cornerValue = 5;
? ? mTagView.labWidht = (SCREENWIDTH-50)/4;
? ? mTagView.textColor = [UIColor grayColor];
? ? mTagView.labHeight = 30;
? ? mTagView.spaceTBMargin = 20;
? ? mTagView.isShowSelectedBg = YES;
? ? mTagView.scrollTagViewDelegate = self;
? ? [mTagView setTagArray:mDataSource];
? ? [self.view addSubview:mTagView];
//此代理可知選中后又取消的標(biāo)簽
- (void)scrollTagView:(ScrollTagView *)tagView didSelectTagAtIndex:(NSInteger)index
{
}
//選中的標(biāo)簽
- (void)scrollTagView:(ScrollTagView *)tagView cancelSelectTagAtIndex:(NSInteger)index
{
}