Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

分词组件/大爆炸/TagFlowView

License

NotificationsYou must be signed in to change notification settings

GIKICoder/GBigbang

Repository files navigation

大爆炸/分词/TagFlowView

License MIT Support CocoaPods 

介绍

这是一个分词组件.用与文本分词,列表展示.参考Pin的分词界面.和UC的bigbang界面.(该项目是GRichLabel 文本选择复制功能的组件之一).欢迎大家star!

特性

  • 可区分标点符号与表情.
  • 可自定义分词展现列表.
  • 分词列表支持滑动/点击选择.
  • 提供默认分词展现Container.

用法

区分标点符号与表情

-(void)bigbang:(NSString*)selection{NSArray * array = [GBigbangBoxbigBang:selection];    __blockNSMutableArray *flows = [NSMutableArrayarray];    [arrayenumerateObjectsUsingBlock:^(GBigbangItem  * obj,NSUInteger idx,BOOL * _Nonnull stop) {    GTagFlowItem *layout = [GTagFlowItemtagFlowItemWithText:obj.text];        [flowsaddObject:layout];if (obj.isSymbolOrEmoji) {            layout.appearance.backgroundColor = [UIColorgrayColor];            layout.appearance.textColor = [UIColorblackColor];        }    }];    [self.containerconfigDatas:flows.copy];    [self.containershow];}

自定义分词展示列表样式

    self.appearance = [GTagFlowAppearancenew];    self.appearance.borderColor = [UIColorblackColor];    self.appearance.textColor = [UIColorblackColor];    self.appearance.borderWidth =1;    self.appearance.backgroundColor = [UIColorwhiteColor];    self.appearance.selectTextColor = [UIColorredColor];    self.appearance.selectBorderColor = [UIColorredColor];    self.appearance.selectBackgroundColor = [UIColorwhiteColor];NSArray *items = [GBigbangBoxbigBang:self.string];NSArray * layouts = [GTagFlowItemfactoryFolwLayoutWithItems:itemswithAppearance:self.appearance];    self.flowView.flowDatas = layouts;    [self.flowViewreloadDatas];

分词列表 使用自定义流水布局

    GTagFlowContainer *container = [GTagFlowContainernew];    self.container = container;/// 使用自定义流水布局    [self.container.flowViewconfigTagCollectionViewLayout];    self.container.actionBtnItems = @[@"复制",@"举报",@"错别字"];    self.container.actionBlock = ^(NSString *actionTitle,NSString *newText) {NSLog(@"点击了 --%@, 选择的文字 --%@",actionTitle,newText);    };NSArray * layouts = [GTagFlowItemfactoryFolwLayoutWithItems:itemswithAppearance:nil];    self.flowView.flowDatas = layouts;    [self.flowViewreloadDatas];

安装

CocoaPods

  1. Addpod 'GBigbang' to your Podfile.
  2. Runpod install orpod update.
  3. Import "GBigbang.h"

手动添加

  1. git clone https://github.com/GIKICoder/GBigbang.git
  2. 选择GBigbang文件夹.拖入项目中即可.

更新

  • 2017/11/24 : 增加自定义布局Layout. bigbang列表可使用自定义布局. 实现固定间距列表.

Demo

Demo

About

分词组件/大爆炸/TagFlowView

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp