如何使用Tag在textview中显示数组数据以及如何添加更多带有搜索的标签功能在ios的用户列表中
问题描述:
当我第一次加载视图时,我想加载一些带有tag.And的数组数据,想要添加多个标签。如何使用Tag在textview中显示数组数据以及如何添加更多带有搜索的标签功能在ios的用户列表中
我使用的是第三方:TITokenField
NSArray * names=ary_ContactDetail;
TIToken * token=[_tokenFieldView.tokenField addTokenWithTitle:[names objectAtIndex:(arc4random() % names.count)]];
[token setAccessoryType:TITokenAccessoryTypeDisclosureIndicator];
// If the size of the token might change, it's a good idea to layout again.
[_tokenFieldView.tokenField layoutTokensAnimated:YES];
NSUInteger tokenCount=_tokenFieldView.tokenField.tokens.count;
[token setTintColor:((tokenCount % 3) == 0 ? [TIToken redTintColor] : ((tokenCount % 2) == 0 ? [TIToken greenTintColor] : [TIToken blueTintColor]))];
请帮我
答
TIToken * token = [[TIToken alloc] initWithTitle:[self displayStringForRepresentedObject:representedObject] representedObject:representedObject];
[_tokenField addToken:token];
使用这种方法
.. - (TIToken *)addTokenWithTitle:(NSString *)title
正如我提到的图书馆,这是代码用于添加新的令牌。我没有这方面的工作经验。而且你还必须管理标签数组。
请添加一些代码。 –
我已添加代码 –
包含什么标签,是否是一个数字?你想增加标签数超时用户来到这个控制器视图或每次应用程序启动? –