{"id":13696490,"url":"https://github.com/pujiaxin33/JXCategoryView","last_synced_at":"2025-05-03T17:31:22.953Z","repository":{"id":37432530,"uuid":"126299577","full_name":"pujiaxin33/JXCategoryView","owner":"pujiaxin33","description":"A powerful and easy to use category view (segmentedcontrol, segmentview, pagingview, pagerview, pagecontrol) (腾讯新闻、今日头条、QQ音乐、网易云音乐、京东、爱奇艺、腾讯视频、淘宝、天猫、简书、微博等所有主流APP分类切换滚动视图)","archived":false,"fork":false,"pushed_at":"2024-08-07T11:28:39.000Z","size":31912,"stargazers_count":6151,"open_issues_count":35,"forks_count":1157,"subscribers_count":92,"default_branch":"master","last_synced_at":"2025-04-29T14:19:25.247Z","etag":null,"topics":["category","categoryview","collectionview","indicator","ios","objective-c","page","pagecontrol","pageview","pagingview","scrollview","segment","segmentedcontrol","segmentedview"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pujiaxin33.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-22T07:54:35.000Z","updated_at":"2025-04-29T09:21:15.000Z","dependencies_parsed_at":"2023-02-17T01:31:36.311Z","dependency_job_id":"f221724c-dc8e-449f-86ed-0ec8bfe607c6","html_url":"https://github.com/pujiaxin33/JXCategoryView","commit_stats":{"total_commits":563,"total_committers":16,"mean_commits":35.1875,"dds":0.2895204262877442,"last_synced_commit":"38bae0a8434ddb47f30aafdf5e25a03b7e843cf4"},"previous_names":[],"tags_count":74,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pujiaxin33%2FJXCategoryView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pujiaxin33%2FJXCategoryView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pujiaxin33%2FJXCategoryView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pujiaxin33%2FJXCategoryView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pujiaxin33","download_url":"https://codeload.github.com/pujiaxin33/JXCategoryView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251516951,"owners_count":21601911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["category","categoryview","collectionview","indicator","ios","objective-c","page","pagecontrol","pageview","pagingview","scrollview","segment","segmentedcontrol","segmentedview"],"created_at":"2024-08-02T18:00:41.163Z","updated_at":"2025-05-03T17:31:20.601Z","avatar_url":"https://github.com/pujiaxin33.png","language":"Objective-C","funding_links":[],"categories":["Objective-C","UI Components"],"sub_categories":[],"readme":"\u003cdiv align=center\u003e\u003cimg src=\"Example/Example/Images/JXCategoryView.png\" width=\"405\" height=\"63\" /\u003e\u003c/div\u003e\n\n[![platform](https://img.shields.io/badge/platform-iOS-blue.svg?style=plastic)](#)\n[![languages](https://img.shields.io/badge/language-objective--c-blue.svg)](#) \n[![cocoapods](https://img.shields.io/badge/cocoapods-supported-4BC51D.svg?style=plastic)](https://cocoapods.org/pods/JXCategoryView)\n[![support](https://img.shields.io/badge/support-ios%208%2B-orange.svg)](#) \n\nA powerful and easy to use category view (segmentedcontrol, segmentview, pagingview, pagerview, pagecontrol) (腾讯新闻、今日头条、QQ 音乐、网易云音乐、京东、爱奇艺、腾讯视频、淘宝、天猫、简书、微博等所有主流 APP 分类切换滚动视图)\n\n与其他的同类三方库对比的优点：\n- 使用协议封装指示器逻辑，可以随心所欲地自定义指示器效果；\n- 提供更加全面丰富、高度自定义的效果；\n- 使用子类化管理 cell 样式，逻辑更清晰，扩展更简单；\n- 高度封装列表容器，使用便捷，完美支持列表的生命周期调用；\n\n## Swift版本\n\n如果你在找 Swift 版本，请点击查看 [JXSegmentedView](https://github.com/pujiaxin33/JXSegmentedView)。\n\n## 效果预览\n\n### 指示器效果预览\n\n说明 | Gif |\n----|------|\nLineView  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/LineView.gif\" width=\"343\" height=\"80\"\u003e |\nLineView延长  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/JDLineStyle.gif\" width=\"343\" height=\"80\"\u003e |\nLineView延长+偏移  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/IQIYILineStyle.gif\" width=\"343\" height=\"80\"\u003e |\nLineView🌈彩虹风格  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/RainbowLineView.gif\" width=\"343\" height=\"80\"\u003e |\nDotLineView点线效果 |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/IndicatorCustomizeGuide.gif\" width=\"334\" height=\"88\"\u003e |\nBallView QQ黏性红点  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/QQBall.gif\" width=\"343\" height=\"84\"\u003e |\nTriangleView 三角形底部  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/TriangleBottom.gif\" width=\"343\" height=\"80\"\u003e |\nTriangleView 三角形顶部  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/TriangleTop.gif\" width=\"343\" height=\"80\"\u003e |\nBackgroundView椭圆形  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/BackgroundEllipseLayer.gif\" width=\"343\" height=\"80\"\u003e |\nBackgroundView椭圆形+阴影  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/BackgroundViewShadow.gif\" width=\"343\" height=\"80\"\u003e |\nBackgroundView长方形  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/Rectangle.gif\" width=\"343\" height=\"80\"\u003e |\nBackgroundView遮罩有背景  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/TitleMask.gif\" width=\"343\" height=\"80\"\u003e |\nBackgroundView遮罩无背景  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/TitleMaskNoBackgroundView.gif\" width=\"343\" height=\"80\"\u003e |\nBackgroundView渐变色  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/GradientBGIndicatorView.gif\" width=\"350\" height=\"80\"\u003e |\nImageView底部(小船)  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/IndicatorImageView.gif\" width=\"343\" height=\"137\"\u003e |\nImageView背景(最佳男歌手)  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/BackgroundImageView.gif\" width=\"343\" height=\"80\"\u003e |\nImageView滚动效果(足球)  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/Football.gif\" width=\"343\" height=\"135\"\u003e |\n混合使用 |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/Mixed.gif\" width=\"343\" height=\"80\"\u003e |\n\n以下均支持上下位置切换：\n`JXCategoryIndicatorLineView`、`JXCategoryIndicatorImageView`、`JXCategoryIndicatorBallView`、`JXCategoryIndicatorTriangleView`\n\n### Cell样式效果预览\n\n说明 | Gif |\n----|------|\n颜色渐变  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/TitleColorGradient.gif\" width=\"343\" height=\"80\"\u003e |\n大小缩放  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/TitleZoom.gif\" width=\"350\" height=\"80\"\u003e |\n大小缩放+底部锚点  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/TitleLabelAnchorBottom.gif\" width=\"350\" height=\"80\"\u003e |\n大小缩放+顶部锚点  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/TitleLabelAnchorTop.gif\" width=\"350\" height=\"80\"\u003e |\n大小缩放+字体粗细  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/TitleZoomStrokeWidth.gif\" width=\"350\" height=\"80\"\u003e |\n大小缩放+点击动画  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/TitleZoomSelectedAnimation.gif\" width=\"350\" height=\"80\"\u003e |\n大小缩放+cell宽度缩放  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/TitleZoomCellWidth.gif\" width=\"350\" height=\"80\"\u003e |\nTitleImage_Top |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/TitleImageTop.gif\" width=\"343\" height=\"80\"\u003e |\nTitleImage_Left |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/TitleImageLeft.gif\" width=\"343\" height=\"80\"\u003e |\nTitleImage_Bottom |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/TitleImageBottom.gif\" width=\"343\" height=\"80\"\u003e |\nTitleImage_Right |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/TitleImageRight.gif\" width=\"343\" height=\"80\"\u003e |\ncell图文混用 |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/CellMixed.gif\" width=\"343\" height=\"90\"\u003e |\nImage |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/CellImage.gif\" width=\"343\" height=\"80\"\u003e |\n数字 |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/Number.gif\" width=\"343\" height=\"80\"\u003e |\n红点 |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/CellRedDot.gif\" width=\"343\" height=\"80\"\u003e |\n多行文本 |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/MultiLineText.gif\" width=\"350\" height=\"80\"\u003e |\n多行富文本 |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/AttributeView.gif\" width=\"343\" height=\"80\"\u003e |\nCell背景色渐变  |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/CellBackgroundColorGradient.gif\" width=\"343\" height=\"80\"\u003e |\n分割线 |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/SeparatorLine.gif\" width=\"343\" height=\"80\"\u003e |\n\n### 特殊效果预览\n\n说明 | Gif |\n----|------|\n数据源过少\u003cbr/\u003e averageCellSpacingEnabled默认为YES |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/averageCellSpacingEnabledYES.gif\" width=\"343\" height=\"80\"\u003e |\n数据源过少\u003cbr/\u003e averageCellSpacingEnabled为NO |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/averageCellSpacingEnabledNO.gif\" width=\"343\" height=\"80\"\u003e |\nSegmentedControl\u003cbr/\u003e参考[`SegmentedControlViewController`](https://github.com/pujiaxin33/JXCategoryView/tree/master/Example/Example/Examples/SegmentedControl/SegmentedControlViewController.m)类 |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/SegmentedControl.gif\" width=\"343\" height=\"80\"\u003e |\n导航栏使用\u003cbr/\u003e参考[`NaviSegmentedControlViewController`](https://github.com/pujiaxin33/JXCategoryView/tree/master/Example/Example/Examples/SegmentedControl/NaviSegmentedControlViewController.m)类 |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/SegmentedControlNavi.gif\" width=\"343\" height=\"80\"\u003e |\n嵌套使用\u003cbr/\u003e参考[`NestViewController`](https://github.com/pujiaxin33/JXCategoryView/tree/master/Example/Example/Examples/Nest/NestViewController.m)类 |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/Nest.gif\" width=\"343\" height=\"272\"\u003e |\n个人主页(上下左右滚动、header悬浮)\u003cbr/\u003e参考[`PagingViewController`](https://github.com/pujiaxin33/JXCategoryView/tree/master/Example/Example/Examples/PagingView/Example/PagingViewController.m)类\u003cbr/\u003e 更多样式请点击查看[JXPagingView库](https://github.com/pujiaxin33/JXPagingView) |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/UserProfile.gif\" width=\"343\" height=\"562\"\u003e |\n垂直列表滚动\u003cbr/\u003e参考[`VerticalListViewController`](https://github.com/pujiaxin33/JXCategoryView/tree/master/Example/Example/Examples/VerticalListView/VerticalListViewController.m)类\u003cbr/\u003e 高仿腾讯视频\u003cbr/\u003e支持UITableView，参考[`VerticalListTableViewController`](https://github.com/pujiaxin33/JXCategoryView/tree/master/Example/Example/Examples/VerticalListView/VerticalListTableViewController.m)\u003cbr/\u003e（背景色异常是录屏软件bug） |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/VerticalList.gif\" width=\"343\" height=\"607\"\u003e |\n| 垂直缩放(仿网易圈圈、脉脉首页)\u003cbr/\u003e参考[`ScrollZoomViewController`](https://github.com/pujiaxin33/JXCategoryView/tree/master/Example/Example/Examples/ScrollZoom/ScrollZoomViewController.m)类 | \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/VerticalZoomTitle.gif\" width=\"350\" height=\"306\"\u003e |\n数据源刷新\u0026列表数据加载\u003cbr/\u003e参考[`LoadDataListContainerViewController`](https://github.com/pujiaxin33/JXCategoryView/tree/master/Example/Example/Examples/LoadData/LoadDataListContainerViewController.m)类 |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/LoadData.gif\" width=\"343\" height=\"619\"\u003e |\n上下滚动隐藏导航栏 | \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/ScrollUp.gif\" width=\"336\" height=\"354\"\u003e |\n京东首页-滚动渐变变小 | \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/jingdo_scroll_small.gif\" width=\"305\" height=\"599\"\u003e |\n\n### 自定义效果预览\n\n收录来自其他使用者的自定义示例，这些自定义类只在 Demo 项目里面，Pod 库并没有这些文件。所以，如果你需要使用这些自定义效果，请通过文件导入的方式。\n\n目的：\n- 参考学习如何自定义；\n- 直接修改自定义示例类以快速实现自己的需求。\n\n欢迎提 PullRequest 进行收录你的自定义效果。\n\n| 说明 | Gif |\n| ----|------|\n| Spring动画指示器 |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/SpringIndicator.gif\" width=\"336\" height=\"70\"\u003e |\n| 富文本数量cell |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/CountCell.gif\" width=\"336\" height=\"70\"\u003e |\n| 左右对齐指示器 |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/AlignmentIndicator.gif\" width=\"336\" height=\"70\"\u003e |\n| 秒杀时间线cell |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/timeline.gif\" width=\"336\" height=\"70\"\u003e |\n| 京东商品排序cell |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/JDProductSort.gif\" width=\"336\" height=\"70\"\u003e |\n| title背景块cell |  \u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/TitleBackgroundExample.gif\" width=\"336\" height=\"70\"\u003e |\n\n## 要求\n\n- iOS 9.0+\n- Xcode 9+\n- Objective-C\n\n## 安装\n\n### 手动\n\nClone 代码，把 Sources 文件夹拖入项目，`#import \"JXCategoryView.h\"` 就可以使用了。\n\n### CocoaPods\n\n```ruby\ntarget '\u003cYour Target Name\u003e' do\n    pod 'JXCategoryView'\nend\n```\n先执行 `pod repo update`，再执行 `pod install`。\n\n## 结构图\n\n\u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/JXCategoryViewStructure.png\" width=\"933\" height=\"482\"\u003e\n\n## 使用\n\n### JXCategoryTitleView 使用示例\n\n1. 初始化 `JXCategoryTitleView`：\n```Objective-C\nself.categoryView = [[JXCategoryTitleView alloc] initWithFrame:CGRectMake(0, 0, WindowsSize.width, 50)];\nself.categoryView.delegate = self;\n[self.view addSubview:self.categoryView];\n```\n\n2. 配置 `JXCategoryTitleView` 的属性：\n```Objective-C\nself.categoryView.titles = @[@\"螃蟹\", @\"麻辣小龙虾\", @\"苹果\"...];\nself.categoryView.titleColorGradientEnabled = YES;\n```\n\n3. 添加指示器：\n```Objective-C\nJXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init];\nlineView.indicatorColor = [UIColor redColor];\nlineView.indicatorWidth = JXCategoryViewAutomaticDimension;\nself.categoryView.indicators = @[lineView];\n```\n\n4. 实现 `JXCategoryViewDelegate` 代理（可选）\n```Objective-C\n// 点击选中或者滚动选中都会调用该方法。适用于只关心选中事件，不关心具体是点击还是滚动选中的。\n- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index;\n\n// 点击选中的情况才会调用该方法\n- (void)categoryView:(JXCategoryBaseView *)categoryView didClickSelectedItemAtIndex:(NSInteger)index;\n\n// 滚动选中的情况才会调用该方法\n- (void)categoryView:(JXCategoryBaseView *)categoryView didScrollSelectedItemAtIndex:(NSInteger)index;\n\n// 正在滚动中的回调\n- (void)categoryView:(JXCategoryBaseView *)categoryView scrollingFromLeftIndex:(NSInteger)leftIndex toRightIndex:(NSInteger)rightIndex ratio:(CGFloat)ratio;\n```\n\n### 列表容器使用示例\n\n#### `JXCategoryListContainerView` 封装类使用示例\n\n`JXCategoryListContainerView` 是对列表视图高度封装的类，具有以下优点：\n\n- 相对于直接使用 `UIScrollView` 自定义，封装度高、代码集中、使用简单；\n- 列表懒加载：当显示某个列表的时候，才进行列表初始化。而不是一次性加载全部列表，性能更优；\n- 支持列表的 `willAppear`、`didAppear`、`willDisappear`、`didDisappear` 生命周期方法调用；\n\n1. 初始化 `JXCategoryListContainerView` 并关联到 `categoryView`：\n```Objective-C\nself.listContainerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self];\n[self.view addSubview:self.listContainerView];\n// 关联到 categoryView\nself.categoryView.listContainer = self.listContainerView;\n```\n\n2. 实现 `JXCategoryListContainerViewDelegate` 代理方法：\n```Objective-C\n// 返回列表的数量\n- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView {\n    return self.titles.count;\n}\n// 根据下标 index 返回对应遵守并实现 `JXCategoryListContentViewDelegate` 协议的列表实例\n- (id\u003cJXCategoryListContentViewDelegate\u003e)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {\n    return [[ListViewController alloc] init];\n}\n```\n\n3. 列表实现 `JXCategoryListContentViewDelegate` 代理方法\n不管列表是 `UIView` 还是 `UIViewController` 都可以，提高使用灵活性，更便于现有的业务接入。\n```Objective-C\n// 返回列表视图\n// 如果列表是 VC，就返回 VC.view\n// 如果列表是 View，就返回 View 自己\n- (UIView *)listView {\n    return self.view;\n}\n```\n\n\n具体点击 [LoadDataListContainerViewController](https://github.com/pujiaxin33/JXCategoryView/tree/master/Example/Example/Examples/LoadData/LoadDataListContainerViewController.m) 查看源代码了解\n\n#### 直接使用 UIScrollView 自定义\n\n因为代码量较多且分散，所有不推荐使用该方法。要正确使用需要注意的地方比较多，尤其对于刚接触 iOS 的同学来说不太友好。\n\n不直接贴代码了，具体点击 [LoadDataListCustomViewController](https://github.com/pujiaxin33/JXCategoryView/tree/master/Example/Example/Examples/LoadData/LoadDataListCustomViewController.m) 查看源代码了解。\n\n\n## 常见问题和答案\n\n❗️❗️❗️这里面包含了许多常见问题和答案，使用之前请务必浏览此文档，或者遇到问题先看此文档❗️❗️❗️\n\n[常见问题和答案总文档](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)\n\n- [个人主页效果更丰富的示例:JXPagingView](https://github.com/pujiaxin33/JXPagingView)\n- [侧滑手势处理](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)\n- [列表的生命周期方法处理](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)\n- [`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)\n- [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)\n- [`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)\n- [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)\n- [`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)\n- [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)\n- [点击切换列表的动画控制](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)\n- [列表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)\n- [列表调用`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)\n- [代码选中指定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)\n- [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)\n- [对父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)\n- [`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)\n- [使用多行文本](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)\n- [列表容器禁止左右滑动](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)\n- [单个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)\n- [点击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)\n- [自定义建议](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)\n\n## 指示器样式自定义\n\n- 需要继承 `JXCategoryIndicatorProtocol` 协议，点击参看 [JXCategoryIndicatorProtocol](https://github.com/pujiaxin33/JXCategoryView/blob/master/Sources/Common/JXCategoryIndicatorProtocol.h)；\n- 提供了继承 `JXCategoryIndicatorProtocol` 协议的基类 `JXCategoryIndicatorComponentView`，里面提供了许多基础属性。点击参看 [JXCategoryIndicatorComponentView](https://github.com/pujiaxin33/JXCategoryView/blob/master/Sources/Indicator/IndicatorViews/JXCategoryIndicatorComponentView.m)；\n- 自定义指示器，请参考已实现的指示器视图，多尝试、多思考，再有问题请提 Issue 或加入反馈 QQ 群。\n\n## Cell 自定义\n\n- 任何子类化需求，view、cell、cellModel 三个都要子类化，即使某个子类 cell 什么事情都不做。用于维护继承链，以免以后子类化都不知道要继承谁了；\n- 如果你想完全自定义 cell 里面的内容，那就继承 `JXCategoryIndicatorView`、`JXCategoryIndicatorCell、`JXCategoryIndicatorCellModel`，就像`JXCategoryTitleView`、`JXCategoryTitleCell、`JXCategoryTitleCellModel`那样去做；\n- 如果你只是在父类进行一些微调，那就继承目标 view、cell、cellModel，对 cell 原有控件微调、或者加入新的控件皆可。就像 `JXCategoryTitleImageView` 系列、`JXCategoryTitleAttributeView` 系列那样去做；\n- Cell 自定义，请参考已实现的 cell 样式，多尝试、多思考，再有问题请提 Issue 或加入反馈 QQ 群\n\n## 常用属性说明\n\n[常用属性说明文档地址](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)\n\n## 更新记录\n\n- 2018.8.21 发布1.0.0版本，更新内容：使用POP（面向协议编程）重构指示器视图；[迁移指南](https://github.com/pujiaxin33/JXCategoryView/blob/master/Migration/1.0.0.md)\n- 2018.8.22 发布1.0.1版本，更新内容：删除zoomEnabled,新增titleLabelZoomEnabled、imageZoomEnabled;\n- 2018.8.23 发布1.0.2版本，更新内容：添加cellWidthZoomEnabled实现腾讯视频效果;\n- 2018.8.24 发布1.0.3版本，更新内容：添加垂直列表滚动效果、指示器添加verticalMargin属性、JXCategoryViewDelegate代理方法优化;\n- 2018.9.4 发布1.0.4版本，更新内容：修复bug、添加cell图文混用示例;\n- 2018.12.19 发布1.1.7版本，更新内容：添加`JXCategoryListContainerView`，高度封装列表逻辑，支持懒加载列表，提升初始化性能；\n- 2019.1.24 发布1.2.2版本，更新内容：非兼容更新接口`- (BOOL)selectCellAtIndex:(NSInteger)index selectedType:(JXCategoryCellSelectedType)selectedType`，自定义有用到该接口的请及时更新。\n- 2019.6.21 发布1.3.13版本，更新内容：将`JXCategoryListCollectionContainerView.dataSource`移动到m实现文件，添加`- (instancetype)initWithDataSource:(id\u003cJXCategoryListCollectionContainerViewDataSource\u003e)dataSource`初始化方法。\n- 2019.7.20 发布1.3.16版本，删除代理方法`- (void)categoryView:(JXCategoryBaseView *)categoryView didClickedItemContentScrollViewTransitionToIndex:(NSInteger)index;`，请使用`contentScrollViewClickTransitionAnimationEnabled`属性。`JXCategoryTitleVerticalZoomView`进行了重构，内容左边距只需要使用`contentEdgeLeft`属性即可。\n- 2019.9.11 发布1.4.0版本，删除一波被标记为弃用的属性和方法；完善列表的生命周期方法的调用；`JXCategoryListCollectionContainerView`类新增和必须要调用`- (void)scrollingFromLeftIndex:(NSInteger)leftIndex toRightIndex:(NSInteger)rightIndex ratio:(CGFloat)ratio selectedIndex:(NSInteger)selectedIndex`和`- (void)didClickSelectedItemAtIndex:(NSInteger)index`两个方法。\n- 2019.9.19 发布1.5.0版本，重构列表容器，具体修改请参考[1.5.0版本迁移指南](https://github.com/pujiaxin33/JXCategoryView/blob/master/Migration/1.5.0%E7%89%88%E6%9C%AC%E8%BF%81%E7%A7%BB%E6%8C%87%E5%8D%97.md)\n\n## 补充\n\n如果刚开始使用`JXCategoryView`，当开发过程中需要支持某种特性时，请务必先搜索使用文档或者源代码。确认是否已经实现支持了想要的特性。请别不要文档和源代码都没有看，就直接提问，这对于大家都是一种时间浪费。如果没有支持想要的特性，欢迎提Issue讨论，或者自己实现提一个PullRequest。\n\n该仓库保持随时更新，对于主流新的分类选择效果会第一时间支持。使用过程中，有任何建议或问题，可以通过以下方式联系我：\u003c/br\u003e\n邮箱：317437084@qq.com \u003c/br\u003e\nQQ群： 112440473\n\n\u003cimg src=\"https://github.com/pujiaxin33/JXExampleImages/blob/master/JXCategoryView/JXCategoryViewQQGroupTwo.JPG\" width=\"300\" height=\"411\"\u003e\n\n喜欢就star❤️一下吧\n\n## License\n\nJXCategoryView is released under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpujiaxin33%2FJXCategoryView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpujiaxin33%2FJXCategoryView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpujiaxin33%2FJXCategoryView/lists"}