展示1:
展示2:
// BarStyle 定义在 HCTabPageConst.h 文件中 如果用Init初始化默认是TabPageScrollBar类型
HCTabPageView *tabPageView = [[HCTabPageView alloc] initWithBarStyle:TabPageScrollSLJumpBar];
[self.view addSubview:tabPageView];
tabPageView.dataSource = self;
tabPageView.delegate = self;
// 加载数据源有错误回调
- (void)tabPageView:(HCTabPageView *)tabPageView loadDataError:(NSString *)error;
// 返回总页数
- (NSInteger)numberOfPagesInTabPageView:(HCTabPageView *)tabPageView;
// 返回子控制器
- (UIViewController *)tabPageView:(HCTabPageView *)tabPageView controllerForPageAtIndex:(NSInteger)index;
// 返回tabbtn的标题
- (NSString *)tabPageView:(HCTabPageView *)tabPageView titleForTabBarAtIndex:(NSInteger)index;
// 点击tab按钮事件回调
- (void)tabPageView:(HCTabPageView *)tabPageView didSelectTabBarAtIndex:(NSInteger)atIndex fromIndex:(NSInteger)fromIndex;
// 页面切换了回调
- (void)tabPageView:(HCTabPageView *)tabPageView didChangePageToIndex:(NSInteger)toIndex formIndex:(NSInteger)formIndex;
// tabPageView会适时调用该方法,并传入offsetX
- (void)setOffsetX:(CGFloat)offsetX animaton:(BOOL)animation;
// tabPageView会适时调用该方法,并传入index
- (void)selectTabAtIndex:(NSInteger)selIndex animation:(BOOL)animation;
// 获得一个数组、元素分别为offsetx对应的selIndex、leftIndex、rightIndex 、lRatio(offsetx到左边btn距离与左右btn之间距离的比)
- (NSArray *)positionsForPageOffsetX:(CGFloat)pageOffsetX;