分頁控制器是基于系統(tǒng)的UIPageViewController實(shí)現(xiàn)
-
支持標(biāo)題欄設(shè)置在導(dǎo)航條上方
image.png -
未讀消息數(shù)設(shè)置
image.png -
多種樣式
image.pngimage.png
-
page嵌套page
image.png -
vc的Scrollview嵌套PageVC
滾動(dòng)示例 標(biāo)簽切換動(dòng)畫

標(biāo)簽動(dòng)畫效果圖
使用示例:
以下是使用繼承YHPageViewController的方式
//標(biāo)簽欄是否顯示在導(dǎo)航條上方
self.segmentMenuShowOnNavigationBar = YES;
//添加他的自控制器 和他的標(biāo)題配置
[self yh_addChildController:[YHColorViewController new] title:@"標(biāo)題1"];
[self yh_addChildController:[YHColorViewController new] title:@"標(biāo)題2"];
[self yh_addChildController:[YHColorViewController new] title:@"標(biāo)題3"];
[self yh_addChildController:[YHTableViewController new] title:@"標(biāo)題1111"];
[self yh_addChildController:[YHTableViewController new] title:@"標(biāo)題222LLLooonnnnnnngg"];
[self yh_addChildController:[YHTableViewController new] titleConfig:^(YHPageTitleItem * _Nonnull item) {
item.title = @"標(biāo)題333";
}];
//標(biāo)簽欄上標(biāo)題字體 間距 布局 指示器 等設(shè)置
self.segmentControl.config.layoutType = YHSegmentLayoutType_Left;
self.segmentControl.config.progressAnimation = YHSegmentAnimation_LineFadein;
self.segmentControl.config.fontSelected = [UIFont yh_pfmOfSize:20];
self.segmentControl.config.fontSelected = [UIFont yh_pfOfSize:16];
//這個(gè)需要調(diào)用一次
[self yh_reloadController];
//初始選中位置
self.selectIndex = 4;
如果要實(shí)現(xiàn)PageViewController他的HeaderView懸浮的方式,可以去繼承YHPageHeaderViewController控制器,也可以單獨(dú)把分頁控制器添加到自定義的YHPageScrollViewscrollview的子類中,自定義滾動(dòng)懸浮效果。
示例:
self.scrollView = [YHPageScrollView new];
//設(shè)置他的最大滾動(dòng)偏移高度
self.scrollView.maxOffsetY = [self yh_pageHeaderHeight];
[self.scrollView setDidScrollBlock:^(CGFloat offy) {
...
}];
[self.view addSubview:self.scrollView];
...
self.pageHeaderView = [self yh_pageHeaderView];
[self.scrollView addSubview:self.pageHeaderView];
...
self.pageViewController = [YHPageViewController new];
...
歡迎 issues me
項(xiàng)目地址 https://github.com/MaiyaT/YHPageViewController





