# 一个十分全面的分段控制器 **Repository Path**: 174/JXCategoryView ## Basic Information - **Project Name**: 一个十分全面的分段控制器 - **Description**: No description available - **Primary Language**: Objective-C - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-07-23 - **Last Updated**: 2023-12-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
[![platform](https://img.shields.io/badge/platform-iOS-blue.svg?style=plastic)](#) [![languages](https://img.shields.io/badge/language-objective--c-blue.svg)](#) [![cocoapods](https://img.shields.io/badge/cocoapods-supported-4BC51D.svg?style=plastic)](https://cocoapods.org/pods/JXCategoryView) [![support](https://img.shields.io/badge/support-ios%208%2B-orange.svg)](#) A powerful and easy to use category view (segmentedcontrol, segmentview, pagingview, pagerview, pagecontrol) (腾讯新闻、今日头条、QQ 音乐、网易云音乐、京东、爱奇艺、腾讯视频、淘宝、天猫、简书、微博等所有主流 APP 分类切换滚动视图) 与其他的同类三方库对比的优点: - 使用协议封装指示器逻辑,可以随心所欲地自定义指示器效果; - 提供更加全面丰富、高度自定义的效果; - 使用子类化管理 cell 样式,逻辑更清晰,扩展更简单; - 高度封装列表容器,使用便捷,完美支持列表的生命周期调用; ## Swift版本 如果你在找 Swift 版本,请点击查看 [JXSegmentedView](https://github.com/pujiaxin33/JXSegmentedView)。 ## 效果预览 ### 指示器效果预览 说明 | Gif | ----|------| LineView | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/112835_a11a7a90_1008455.gif "LineView.gif") | LineView延长 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/113002_5a470ca8_1008455.gif "LineView延长.gif") | LineView延长+偏移 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/113037_cc2af7e9_1008455.gif "LineView延长+偏移.gif") | LineView🌈彩虹风格 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/113057_e2db4ef8_1008455.gif "LineView🌈彩虹风格.gif") | DotLineView点线效果 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/113133_20575f08_1008455.gif "DotLineView点线效果.gif") | BallView QQ黏性红点 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/113155_de8835ee_1008455.gif "BallView QQ黏性红点.gif") | TriangleView 三角形底部 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/113229_3c020833_1008455.gif "TriangleView 三角形底部.gif") | TriangleView 三角形顶部 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/113241_6a7c41f5_1008455.gif "TriangleView 三角形顶部.gif") | BackgroundView椭圆形 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/113305_76fcb6a5_1008455.gif "BackgroundView椭圆形.gif") | BackgroundView椭圆形+阴影 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/113320_ae81662d_1008455.gif "BackgroundView椭圆形+阴影.gif") | BackgroundView长方形 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/113340_553d2268_1008455.gif "BackgroundView长方形.gif") | BackgroundView遮罩有背景 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/113356_68df232a_1008455.gif "BackgroundView遮罩有背景.gif") | BackgroundView遮罩无背景 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/113412_ec4e4dc6_1008455.gif "BackgroundView遮罩无背景.gif") | BackgroundView渐变色 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/113438_4787d401_1008455.gif "BackgroundView渐变色.gif") | ImageView底部(小船) | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/113452_cb2e6cfb_1008455.gif "ImageView底部(小船).gif") | ImageView背景(最佳男歌手) | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/113507_0a4a570e_1008455.gif "ImageView背景(最佳男歌手).gif") | ImageView滚动效果(足球) | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/113518_79e72362_1008455.gif "ImageView滚动效果(足球).gif") | 混合使用 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/113542_ec1c3a96_1008455.gif "混合使用.gif") | 以下均支持上下位置切换: `JXCategoryIndicatorLineView`、`JXCategoryIndicatorImageView`、`JXCategoryIndicatorBallView`、`JXCategoryIndicatorTriangleView` ### Cell样式效果预览 说明 | Gif | ----|------| 颜色渐变 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/114510_0de9dad9_1008455.gif "颜色渐变.gif") | 大小缩放 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/114657_394bf7aa_1008455.gif "大小缩放.gif") | 大小缩放+底部锚点 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/114809_b3cc0ff4_1008455.gif "大小缩放+底部锚点.gif") | 大小缩放+顶部锚点 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/114834_2975090e_1008455.gif "大小缩放+顶部锚点.gif") | 大小缩放+字体粗细 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/114852_14acd0bb_1008455.gif "大小缩放+字体粗细.gif") | 大小缩放+点击动画 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/114906_da64c4ef_1008455.gif "大小缩放+点击动画.gif") | 大小缩放+cell宽度缩放 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/114920_4c513358_1008455.gif "大小缩放+cell宽度缩放.gif") | TitleImage_Top | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/114952_cafcc42f_1008455.gif "TitleImage_Top.gif") | TitleImage_Left | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/115006_cb5b712f_1008455.gif "TitleImage_Left.gif") | TitleImage_Bottom | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/115017_2de8ee9b_1008455.gif "TitleImage_Bottom.gif") | TitleImage_Right | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/115029_adfed8f2_1008455.gif "TitleImage_Right.gif") | cell图文混用 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/140836_5d632e27_1008455.gif "cell图文混用.gif") | Image | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/140849_caa73626_1008455.gif "Image.gif") | 数字 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/115139_8f31dff5_1008455.gif "数字.gif") | 红点 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/140903_db02ce59_1008455.gif "红点.gif") | 多行文本 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/140918_af9b91de_1008455.gif "多行文本.gif") | 多行富文本 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/140931_4f81251b_1008455.gif "多行富文本.gif") | Cell背景色渐变 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/140946_12da594a_1008455.gif "Cell背景色渐变.gif") | 分割线 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/140958_a3244ea3_1008455.gif "分割线.gif") | ### 特殊效果预览 说明 | Gif | ----|------| 数据源过少
averageCellSpacingEnabled默认为YES | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/141337_d46718a9_1008455.gif "数据源过少_YES.gif") | 数据源过少
averageCellSpacingEnabled为NO | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/141352_0de3683a_1008455.gif "数据源过少_NO.gif") | SegmentedControl
参考[`SegmentedControlViewController`](https://github.com/pujiaxin33/JXCategoryView/tree/master/Example/Example/Examples/SegmentedControl/SegmentedControlViewController.m)类 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/141418_41799d1a_1008455.gif "SegmentedControl.gif") | 导航栏使用
参考[`NaviSegmentedControlViewController`](https://github.com/pujiaxin33/JXCategoryView/tree/master/Example/Example/Examples/SegmentedControl/NaviSegmentedControlViewController.m)类 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/141447_492d747d_1008455.gif "导航栏使用.gif") | 嵌套使用
参考[`NestViewController`](https://github.com/pujiaxin33/JXCategoryView/tree/master/Example/Example/Examples/Nest/NestViewController.m)类 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/141506_dc5386b2_1008455.gif "嵌套使用.gif") | 个人主页(上下左右滚动、header悬浮)
参考[`PagingViewController`](https://github.com/pujiaxin33/JXCategoryView/tree/master/Example/Example/Examples/PagingView/Example/PagingViewController.m)类
更多样式请点击查看[JXPagingView库](https://github.com/pujiaxin33/JXPagingView) | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/141540_fff73c49_1008455.gif "个人主页.gif") | 垂直列表滚动
参考[`VerticalListViewController`](https://github.com/pujiaxin33/JXCategoryView/tree/master/Example/Example/Examples/VerticalListView/VerticalListViewController.m)类
高仿腾讯视频
支持UITableView,参考[`VerticalListTableViewController`](https://github.com/pujiaxin33/JXCategoryView/tree/master/Example/Example/Examples/VerticalListView/VerticalListTableViewController.m)
(背景色异常是录屏软件bug) | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/141628_e02d6376_1008455.gif "垂直列表滚动.gif") | | 垂直缩放(仿网易圈圈、脉脉首页)
参考[`ScrollZoomViewController`](https://github.com/pujiaxin33/JXCategoryView/tree/master/Example/Example/Examples/ScrollZoom/ScrollZoomViewController.m)类 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/141704_b701f999_1008455.gif "垂直缩放.gif") | 数据源刷新&列表数据加载
参考[`LoadDataListContainerViewController`](https://github.com/pujiaxin33/JXCategoryView/tree/master/Example/Example/Examples/LoadData/LoadDataListContainerViewController.m)类 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/141745_18aa193f_1008455.gif "数据源刷新&列表数据加载.gif") | 上下滚动隐藏导航栏 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/141727_51a9c148_1008455.gif "上下滚动隐藏导航栏.gif") | ### 自定义效果预览 收录来自其他使用者的自定义示例,这些自定义类只在 Demo 项目里面,Pod 库并没有这些文件。所以,如果你需要使用这些自定义效果,请通过文件导入的方式。 目的: - 参考学习如何自定义; - 直接修改自定义示例类以快速实现自己的需求。 欢迎提 PullRequest 进行收录你的自定义效果。 | 说明 | Gif | | ----|------| | Spring动画指示器 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/144835_32cac51e_1008455.gif "Spring动画指示器.gif") | | 富文本数量cell | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/144852_745fd00d_1008455.gif "富文本数量cell.gif") | | 左右对齐指示器 | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/144905_25339bb0_1008455.gif "左右对齐指示器.gif") | | 秒杀时间线cell | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/144919_a7eddb85_1008455.gif "秒杀时间线cell.gif") | | 京东商品排序cell | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/144932_43c2e43d_1008455.gif "京东商品排序cell.gif") | | title背景块cell | ![输入图片说明](https://images.gitee.com/uploads/images/2021/0723/144944_5fb6d828_1008455.gif "title背景块cell.gif") | ## 要求 - iOS 9.0+ - Xcode 9+ - Objective-C ## 安装 ### 手动 Clone 代码 ### CocoaPods ```ruby target '' do pod 'JXCategoryView' end ``` 先执行 `pod repo update`,再执行 `pod install`。 ## 结构图 ![结构图](https://images.gitee.com/uploads/images/2021/0723/145140_adceae93_1008455.png "结构图.png") ## 使用 ### JXCategoryTitleView 使用示例 1. 初始化 `JXCategoryTitleView`: ```Objective-C self.categoryView = [[JXCategoryTitleView alloc] initWithFrame:CGRectMake(0, 0, WindowsSize.width, 50)]; self.categoryView.delegate = self; [self.view addSubview:self.categoryView]; ``` 2. 配置 `JXCategoryTitleView` 的属性: ```Objective-C self.categoryView.titles = @[@"螃蟹", @"麻辣小龙虾", @"苹果"...]; self.categoryView.titleColorGradientEnabled = YES; ``` 3. 添加指示器: ```Objective-C JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init]; lineView.indicatorColor = [UIColor redColor]; lineView.indicatorWidth = JXCategoryViewAutomaticDimension; self.categoryView.indicators = @[lineView]; ``` 4. 实现 `JXCategoryViewDelegate` 代理(可选) ```Objective-C // 点击选中或者滚动选中都会调用该方法。适用于只关心选中事件,不关心具体是点击还是滚动选中的。 - (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index; // 点击选中的情况才会调用该方法 - (void)categoryView:(JXCategoryBaseView *)categoryView didClickSelectedItemAtIndex:(NSInteger)index; // 滚动选中的情况才会调用该方法 - (void)categoryView:(JXCategoryBaseView *)categoryView didScrollSelectedItemAtIndex:(NSInteger)index; // 正在滚动中的回调 - (void)categoryView:(JXCategoryBaseView *)categoryView scrollingFromLeftIndex:(NSInteger)leftIndex toRightIndex:(NSInteger)rightIndex ratio:(CGFloat)ratio; ``` ### 列表容器使用示例 #### `JXCategoryListContainerView` 封装类使用示例 `JXCategoryListContainerView` 是对列表视图高度封装的类,具有以下优点: - 相对于直接使用 `UIScrollView` 自定义,封装度高、代码集中、使用简单; - 列表懒加载:当显示某个列表的时候,才进行列表初始化。而不是一次性加载全部列表,性能更优; - 支持列表的 `willAppear`、`didAppear`、`willDisappear`、`didDisappear` 生命周期方法调用; 1. 初始化 `JXCategoryListContainerView` 并关联到 `categoryView`: ```Objective-C self.listContainerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self]; [self.view addSubview:self.listContainerView]; // 关联到 categoryView self.categoryView.listContainer = self.listContainerView; ``` 2. 实现 `JXCategoryListContainerViewDelegate` 代理方法: ```Objective-C // 返回列表的数量 - (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView { return self.titles.count; } // 根据下标 index 返回对应遵守并实现 `JXCategoryListContentViewDelegate` 协议的列表实例 - (id)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index { return [[ListViewController alloc] init]; } ``` 3. 列表实现 `JXCategoryListContentViewDelegate` 代理方法 不管列表是 `UIView` 还是 `UIViewController` 都可以,提高使用灵活性,更便于现有的业务接入。 ```Objective-C // 返回列表视图 // 如果列表是 VC,就返回 VC.view // 如果列表是 View,就返回 View 自己 - (UIView *)listView { return self.view; } ``` 具体点击 [LoadDataListContainerViewController](https://github.com/pujiaxin33/JXCategoryView/tree/master/Example/Example/Examples/LoadData/LoadDataListContainerViewController.m) 查看源代码了解 #### 直接使用 UIScrollView 自定义 因为代码量较多且分散,所有不推荐使用该方法。要正确使用需要注意的地方比较多,尤其对于刚接触 iOS 的同学来说不太友好。 不直接贴代码了,具体点击 [LoadDataListCustomViewController](https://github.com/pujiaxin33/JXCategoryView/tree/master/Example/Example/Examples/LoadData/LoadDataListCustomViewController.m) 查看源代码了解。 ## 常见问题和答案 ❗️❗️❗️这里面包含了许多常见问题和答案,使用之前请务必浏览此文档,或者遇到问题先看此文档❗️❗️❗️ [常见问题和答案总文档](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E4%BD%BF%E7%94%A8%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9.md) - [个人主页效果更丰富的示例:JXPagingView](https://github.com/pujiaxin33/JXPagingView) - [侧滑手势处理](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E4%BE%A7%E6%BB%91%E6%89%8B%E5%8A%BF%E5%A4%84%E7%90%86.md) - [列表的生命周期方法处理](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E5%88%97%E8%A1%A8%E7%9A%84%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F%E6%96%B9%E6%B3%95%E5%A4%84%E7%90%86.md) - [`JXCategoryListContainerType`的`scrollView`和`collectionView`对比](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E4%BD%BF%E7%94%A8%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9.md#jxcategorylistcontainertype%E7%9A%84scrollview%E5%92%8Ccollectionview%E5%AF%B9%E6%AF%94) - [cell左滑删除](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E4%BD%BF%E7%94%A8%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9.md#cell%E5%B7%A6%E6%BB%91%E5%88%A0%E9%99%A4) - [`FDFullscreenPopGesture`等全屏手势处理](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E5%85%A8%E5%B1%8F%E6%89%8B%E5%8A%BF%E5%A4%84%E7%90%86.md) - [JXCategoryView数据源刷新](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E4%BD%BF%E7%94%A8%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9.md#jxcategoryview%E6%95%B0%E6%8D%AE%E6%BA%90%E5%88%B7%E6%96%B0) - [`reloadDataWithoutListContainer`方法使用说明](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E4%BD%BF%E7%94%A8%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9.md#reloaddatawithoutlistcontainer%E6%96%B9%E6%B3%95%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E) - [listContainer或contentScrollView关联说明](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E4%BD%BF%E7%94%A8%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9.md#listcontainer%E6%88%96contentscrollview%E5%85%B3%E8%81%94%E8%AF%B4%E6%98%8E) - [点击切换列表的动画控制](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E4%BD%BF%E7%94%A8%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9.md#%E7%82%B9%E5%87%BB%E5%88%87%E6%8D%A2%E5%88%97%E8%A1%A8%E7%9A%84%E5%8A%A8%E7%94%BB%E6%8E%A7%E5%88%B6) - [列表cell点击跳转示例](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E4%BD%BF%E7%94%A8%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9.md#%E5%88%97%E8%A1%A8cell%E7%82%B9%E5%87%BB%E8%B7%B3%E8%BD%AC%E7%A4%BA%E4%BE%8B) - [列表调用`presentViewController`方法](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E4%BD%BF%E7%94%A8%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9.md#%E5%88%97%E8%A1%A8%E8%B0%83%E7%94%A8presentviewcontroller%E6%96%B9%E6%B3%95) - [代码选中指定index](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E4%BD%BF%E7%94%A8%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9.md#%E4%BB%A3%E7%A0%81%E9%80%89%E4%B8%AD%E6%8C%87%E5%AE%9Aindex) - [JXCategoryView.collectionView高度取整说明](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E4%BD%BF%E7%94%A8%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9.md#jxcategoryviewcollectionview%E9%AB%98%E5%BA%A6%E5%8F%96%E6%95%B4%E8%AF%B4%E6%98%8E) - [对父VC的automaticallyAdjustsScrollViewInsets属性设置为NO](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E4%BD%BF%E7%94%A8%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9.md#%E5%AF%B9%E7%88%B6vc%E7%9A%84automaticallyadjustsscrollviewinsets%E5%B1%9E%E6%80%A7%E8%AE%BE%E7%BD%AE%E4%B8%BAno) - [`JXCategoryListContainerView`内部使用`UIViewController`当做列表容器使用说明](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E4%BD%BF%E7%94%A8%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9.md#jxcategorylistcontainerview%E5%86%85%E9%83%A8%E4%BD%BF%E7%94%A8uiviewcontroller%E5%BD%93%E5%81%9A%E5%88%97%E8%A1%A8%E5%AE%B9%E5%99%A8%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E) - [使用多行文本](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E4%BD%BF%E7%94%A8%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9.md#%E4%BD%BF%E7%94%A8%E5%A4%9A%E8%A1%8C%E6%96%87%E6%9C%AC) - [列表容器禁止左右滑动](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E4%BD%BF%E7%94%A8%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9.md#%E5%88%97%E8%A1%A8%E5%AE%B9%E5%99%A8%E7%A6%81%E6%AD%A2%E5%B7%A6%E5%8F%B3%E6%BB%91%E5%8A%A8) - [单个cell刷新 ](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E4%BD%BF%E7%94%A8%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9.md#%E5%8D%95%E4%B8%AAcell%E5%88%B7%E6%96%B0) - [点击item时指示器和列表滚动时效果一致](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E4%BD%BF%E7%94%A8%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9.md#%E7%82%B9%E5%87%BBitem%E6%97%B6%E6%8C%87%E7%A4%BA%E5%99%A8%E5%92%8C%E5%88%97%E8%A1%A8%E6%BB%9A%E5%8A%A8%E6%97%B6%E6%95%88%E6%9E%9C%E4%B8%80%E8%87%B4) - [自定义建议](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E4%BD%BF%E7%94%A8%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9.md#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%BB%BA%E8%AE%AE) ## 指示器样式自定义 - 需要继承 `JXCategoryIndicatorProtocol` 协议,点击参看 [JXCategoryIndicatorProtocol](https://github.com/pujiaxin33/JXCategoryView/blob/master/Sources/Common/JXCategoryIndicatorProtocol.h); - 提供了继承 `JXCategoryIndicatorProtocol` 协议的基类 `JXCategoryIndicatorComponentView`,里面提供了许多基础属性。点击参看 [JXCategoryIndicatorComponentView](https://github.com/pujiaxin33/JXCategoryView/blob/master/Sources/Indicator/IndicatorViews/JXCategoryIndicatorComponentView.m); - 自定义指示器,请参考已实现的指示器视图,多尝试、多思考,再有问题请提 Issue 或加入反馈 QQ 群。 ## Cell 自定义 - 任何子类化需求,view、cell、cellModel 三个都要子类化,即使某个子类 cell 什么事情都不做。用于维护继承链,以免以后子类化都不知道要继承谁了; - 如果你想完全自定义 cell 里面的内容,那就继承 `JXCategoryIndicatorView`、`JXCategoryIndicatorCell、`JXCategoryIndicatorCellModel`,就像`JXCategoryTitleView`、`JXCategoryTitleCell、`JXCategoryTitleCellModel`那样去做; - 如果你只是在父类进行一些微调,那就继承目标 view、cell、cellModel,对 cell 原有控件微调、或者加入新的控件皆可。就像 `JXCategoryTitleImageView` 系列、`JXCategoryTitleAttributeView` 系列那样去做; - Cell 自定义,请参考已实现的 cell 样式,多尝试、多思考,再有问题请提 Issue 或加入反馈 QQ 群 ## 常用属性说明 [常用属性说明文档地址](https://github.com/pujiaxin33/JXCategoryView/blob/master/Document/%E5%B8%B8%E7%94%A8%E5%B1%9E%E6%80%A7%E8%AF%B4%E6%98%8E.md) 喜欢就star❤️一下吧