TUIFaceView Class Reference
Inherits from | UIView |
---|---|
Declared in | TUIFaceView.h TUIFaceView.m |
Overview
【模块名称】TUIFaceView 【功能说明】用于实现聊天窗口中的表情浏览视图,即在默认状态下点击笑脸图标浮现的视图。 通过本视图,您可以查看您可以使用的所有表情,在不同的表情分组间进行浏览,进一步进行表情的选择与发送。 同时,本视图已经整合了字符串类型的表情(如[微笑])的编辑功能,以及图像类表情的选取与发送功能。
Other Methods
lineView
线视图 在视图中的分界线,使得表情视图与其他视图在视觉上区分,从而让表情视图在显示逻辑上更加清晰有序。
@property (nonatomic, strong) UIView *lineView
Declared In
TUIFaceView.h
faceCollectionView
表情视图的 CollectionView 包含多行表情,并配合 faceFlowLayout 进行灵活统一的视图布局。
@property (nonatomic, strong) UICollectionView *faceCollectionView
Declared In
TUIFaceView.h
faceFlowLayout
faceCollectionView 的流水布局 配合 faceCollectionView,用来维护表情视图的布局,使表情排布更加美观。能够设置布局方向、行间距、cell 间距等。
@property (nonatomic, strong) UICollectionViewFlowLayout *faceFlowLayout
Declared In
TUIFaceView.h
pageControl
分页控制 用于实现表情的多页浏览,能够滑动切换表情页,在表情页下方以原点形式显示总页数以及当前页数等功能。
@property (nonatomic, strong) UIPageControl *pageControl
Declared In
TUIFaceView.h
delegate
委托变量,被委托者 需要实现 TFaceViewDelegate 协议中要求的功能。
@property (nonatomic, weak) id<TFaceViewDelegate> delegate
Declared In
TUIFaceView.h
– scrollToFaceGroupIndex:
滑动到指定表情分组。 根据用户点击的表情分组的下标,切换到对应的表情分组下。
- (void)scrollToFaceGroupIndex:(NSInteger)index
Parameters
index |
目的分组的组号索引,从0开始。 |
---|
Declared In
TUIFaceView.h
– setData:
设置数据。 用来进行 TUIFaceView 的初始化或在需要时更新 faceView 中的数据。
- (void)setData:(NSMutableArray *)data
Parameters
data |
需要设置的数据(TFaceGroup)。在此 NSMutableArray 中存放的对象为 TFaceGroup,即表情组。 |
---|
Declared In
TUIFaceView.h
Other Methods
– numberOfSectionsInCollectionView:
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
– collectionView:numberOfItemsInSection:
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
– collectionView:cellForItemAtIndexPath:
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
– collectionView:didSelectItemAtIndexPath:
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
– collectionView:layout:sizeForItemAtIndexPath:
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath