# LBPageMenu **Repository Path**: liuboliu/lbpage-menu ## Basic Information - **Project Name**: LBPageMenu - **Description**: 一款优雅的分页标题组件,使用简单 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-09-21 - **Last Updated**: 2022-12-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: 分页标签, 滚动标题 ## README # LBPageMenu [![CI Status](https://img.shields.io/travis/liuboliu/LBPageMenu.svg?style=flat)](https://travis-ci.org/liuboliu/LBPageMenu) [![Version](https://img.shields.io/cocoapods/v/LBPageMenu.svg?style=flat)](https://cocoapods.org/pods/LBPageMenu) [![License](https://img.shields.io/cocoapods/l/LBPageMenu.svg?style=flat)](https://cocoapods.org/pods/LBPageMenu) [![Platform](https://img.shields.io/cocoapods/p/LBPageMenu.svg?style=flat)](https://cocoapods.org/pods/LBPageMenu) ## Example To run the example project, clone the repo, and run `pod install` from the Example directory first. ## Requirements ## Installation LBPageMenu is available through [CocoaPods](https://cocoapods.org). To install it, simply add the following line to your Podfile: ```ruby pod 'LBPageMenu' #使用方法 #初始化 - (LBPageMenu *)menu { if (!_menu) { LBPageMenuConfiguration *configuration = [[LBPageMenuConfiguration alloc] init]; configuration.unSelectedTitleColor = [UIColor cyanColor]; configuration.selectedTittleColor = [UIColor magentaColor]; ///指示条滚动风格,这里配置拉伸风格(默认是普通滚动) configuration.indicatorStyle = LBPageMenuIndicatorStyleStetch; _menu = [[LBPageMenu alloc] initWithFrame:CGRectMake(0, 100, CGRectGetWidth(self.view.bounds), 50) configuration:configuration]; _menu.delegate = self; _menu.backgroundColor = [UIColor lightGrayColor]; } return _menu; } # 配置标题, 内容scrollView, 首次选中的item self.titleArray = @[@"标题", @"中秋节", @"祝你快乐",@"啦啦啦",@"标题", @"中秋节", @"祝你快乐",@"啦啦啦",@"标题", @"中秋节", @"祝你快乐",@"啦啦啦",@"标题", @"中秋节", @"祝你快乐",@"啦啦啦"]; self.menu.bridgeScrollView = self.scrollView; [self.menu setItems:self.titleArray selectedItemIndex:0]; #实现协议方法 #pragma mark - LBPageMenuDelegate - (void)selectItemAtIndex:(NSInteger)index { [self.scrollView setContentOffset:CGPointMake(CGRectGetWidth(self.view.bounds) * index, 0) animated:YES]; } # 跟手滚动 - (void)scrollViewDidScroll:(UIScrollView *)scrollView { [self.menu beginMoveTrackerFollowScrollView:scrollView]; } ``` ## DefaultStyle ![Image text](https://gitee.com/liuboliu/lbpage-menu/raw/master/2021-09-21%2021.32.33.gif) ## StretchStyle ![Image text](https://gitee.com/liuboliu/lbpage-menu/raw/master/2021-09-24%2007.38.08.gif) ## StretchDesignatedLengthStyle ![Image text](https://gitee.com/liuboliu/lbpage-menu/raw/master/2021-09-24%2021.06.54.gif) ## LBPageMenuIndicatorStyleLineChange ![Image text](https://gitee.com/liuboliu/lbpage-menu/raw/master/2022-12-04%2017.48.32.gif) ## Author liuboliu, 2534660131@qq.com ## License LBPageMenu is available under the MIT license. See the LICENSE file for more info.