ZPSegmentBarOC 该框架分为OC和Swfit两个版本:点击前往Swift版本
集成该框架步骤:
ZPSegmentBarStyle * style=[[ZPSegmentBarStyle alloc] init];
style.isScrollEnabled=YES;//导航条是否可以滚动,默认YES;
style.isShowCover=YES;//导航条是否显示遮盖效果,默认YES;
style.coverViewMargin=6;//遮盖间距;
style.isShowBottomLine=YES;//导航条下方是否显示BottomLine,默认YES;
style.bottomLineColor=[UIColor orangeColor];//BottomLine 的颜色;
style.isNeedScale=YES;//导航条是否有放大效果,默认YES;
style.titleViewBG=[UIColor purpleColor];//导航条背景颜色,默认为紫色;
...
...
...
通过配置我们需要的样式可以轻松的实现遮盖
文字缩放
下划线
文字颜色变化
等样式.
ZPSegmentView * segmentView=[[ZPSegmentView alloc]initWithFrame:frame];
[segmentView setupWithtitles:titles style:style childVcs:childVcs parentVc:self];
[self.view addSubview:segmentView];
如果是导航控制器,我们需要在集成的View
中 设置
[self setAutomaticallyAdjustsScrollViewInsets:NO];
ZPSegmentBarOC is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'ZPSegmentBarOC', '~> 0.2.0'
zswangzp@163.com, zswangzp@163.com
ZPSegmentBarOC is available under the MIT license. See the LICENSE file for more info.