# CGXVerticalMenuView-OC
## 仿京东、淘宝等主流APP商品分类菜单
- 下载链接:https://github.com/974794055/CGXVerticalMenuView-OC.git
- pod名称 :CGXVerticalMenuView-OC
- 最新版本号: 1.2.2
## 支持效果:
- 1、左侧自定义标签view
- 2、右侧多分区滑动
- 3、右侧每个分区定义不同背景色
- 4、左右联动,右侧下拉上滑翻页
## 效果预览
### 效果预览图
说明 | Gif |
----|------|
不联动 |
|
联动 |
|
UICollectionView单行联动 |
|
UICollectionView多行联动 |
|
### 目的:
- 参考学习如何自定义
- 快速实现自己的需求
## 要求
- iOS 8.0+
- Xcode 9+
- Objective-C
## 安装
### 手动
Clone代码,把CGXVerticalMenuView文件夹拖入项目,#import "CGXVerticalMenu.h",就可以使用了;
### CocoaPods
```ruby
target '' do
pod 'CGXVerticalMenuView-OC'
end
```
先执行`pod repo update`,再执行`pod install`
## 结构图
## 使用
### CGXVerticalMenuView-OC普通布局使用示例
1.初始化CGXPageCollectionGeneralView
```Objective-C
self.menuView = [[CGXVerticalMenuCategoryView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, kSafeVCHeight)];
self.menuView.backgroundColor = [UIColor whiteColor];
self.menuView.delegate = self;
self.menuView.dataSouce = self;
[self.view addSubview:self.menuView];
self.menuView.titleWidth = 100;
self.menuView.leftBgColor = [UIColor colorWithWhite:0.93 alpha:1];;
self.menuView.rightBgColor = [UIColor whiteColor];
CGXVerticalMenuIndicatorBackgroundView *backgroundView = [[CGXVerticalMenuIndicatorBackgroundView alloc] init];
backgroundView.backgroundViewColor = [UIColor orangeColor];
// backgroundView.backgroundViewHeight = 30;
backgroundView.backgroundViewCornerRadius = 0;
// backgroundView.backgroundViewWidth = (SCREEN_WIDTH-50)/4.0;
CGXVerticalMenuIndicatorLineView *lineView = [[CGXVerticalMenuIndicatorLineView alloc] init];
lineView.backgroundColor = [UIColor redColor];
lineView.positionType = CGXVerticalMenuIndicatorLinePosition_Left;
self.menuView.indicators = @[lineView,backgroundView];
```
2.加载CGXPageCollectionGeneralView数据源
```Objective-C
NSMutableArray *titleArr = [NSMutableArray arrayWithObjects:@"推荐",@"要闻",@"河北",@"财经",@"娱乐",@"体育",@"社会",@"NBA",@"视频",@"汽车",@"图片",@"科技",@"军事",@"国际",@"数码",@"星座",@"电影",@"时尚",@"文化",@"游戏",@"教育",@"动漫",@"政务",@"纪录片",@"房产",@"佛学",@"股票",@"理财", nil];
NSMutableArray *dataArr = [NSMutableArray array];
for (int i = 0; i
邮 箱:974794055@qq.com
群名称:潮流App-iOS交流
QQ 群:227219165
QQ 号:974794055
喜欢就star❤️一下吧
## License
CGXVerticalMenuView-OC is released under the MIT license.