ZLPagerTabController支持各种页面标签展示效果,类似于今日头条、网易新闻、微信读书等App的标签页切换效果,支持自定义标签样式、指示器样式等
1.保留了控制器的完整生命周期方法,方便在各个子控制器中处理业务逻辑。
2.支持自定义标签样式,包括字体、颜色、间距等。
3.支持自定义指示器样式,包括颜色、高度、宽度等。
4.支持标签页面嵌套使用,实现复杂的标签切换效果。
5.支持横竖屏切换,自动适配屏幕尺寸变化。
6.支持悬浮效果,标签栏可以悬浮在内容上方。
7.支持动态添加和删除标签,方便实现动态内容展示。
To run the example project, clone the repo, and run pod install from the Example directory first.
ZLPagerTabController is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'ZLPagerTabController'//返回子控制器
- (NSArray<UIViewController *> *)childViewControllersForPagerViewController:(ZLPagerViewController *)pagerViewController {
UIViewController *vc1 = [[UIViewController alloc] init];
UIViewController *vc2 = [[UIViewController alloc] init];
UIViewController *vc3 = [[UIViewController alloc] init];
return @[vc1, vc2, vc3];
}
//返回标签数据
- (ZLTabBarCellItem *)pagerViewController:(ZLPagerTabBarViewController *)pagerViewController forIndex:(NSInteger)index {
ZLTabBarCellItem *item = [[ZLTabBarCellItem alloc] init];
item.title = @"标签1";
item.selectedTitleColor = UIColor.orangeColor;
return item;
}fanpeng, [email protected]
ZLPagerTabController is available under the MIT license. See the LICENSE file for more info.