- demo
it support autoLayout , code etc.
//auto layout and frame code both of them are ok!
NSArray *pageNamesArray = @[@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController"];
LBHeaderPageView *headerPageView = [LBHeaderPageView headerPageViewWithClassNamesArray:pageNamesArray titlesArray:@[@"首页",@"娱乐",@"体育",@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",@"11"]];
[self.view addSubview:headerPageView];
[headerPageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(10);
make.right.mas_equalTo(-10);
make.top.mas_equalTo(100);
make.bottom.mas_equalTo(-50);
}];
NSArray *pageNamesArray = @[@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController"];
LBHeaderPageView *headerPageView = [LBHeaderPageView headerPageViewWithClassNamesArray:pageNamesArray titlesArray:@[@"首页",@"娱乐",@"体育",@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",@"11"]];
[self.view addSubview:headerPageView];
headerPageView.frame = CGRectMake(0, 74, [UIScreen mainScreen].bounds.size.width , 200);
NSArray *pageNamesArray2 = @[@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController",@"UIViewController"];
LBHeaderPageView *headerPageView2 = [LBHeaderPageView headerPageViewWithClassNamesArray:pageNamesArray2 titlesArray:@[@"首页",@"娱乐",@"体育",@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",@"11"]];
headerPageView2.lineWidthIsNeedAutoChange = YES;
[self.view addSubview:headerPageView2];
headerPageView2.frame = CGRectMake(0, headerPageView.LB_y + headerPageView.LB_height + 10, [UIScreen mainScreen].bounds.size.width , 100);
To run the example project, clone the repo, and run pod install
from the Example directory first.
LBPageView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'LBPageView'
[email protected], [email protected]
LBPageView is available under the MIT license. See the LICENSE file for more info.