Skip to content

左右滑动切换页面,TabBar支持小红点显示。

Notifications You must be signed in to change notification settings

HaiTeng-Wang/PageSegment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PageSegment

Language

Platform iOS CocoaPods compatible License: MIT

基于PagerTab基础上进行修改。

原贡献者,貌似消失于Github界,此控件也没有持续更新。所有放到这里希望大家可以一起pull requests

文件,代码少,易于自己修改成适合自己项目的工程控件。TabBar可显示小红点。


效果图

多个BarItem

Features

  • 容器视图控制器管理页面,左右滑动切换页面控制器
  • 可配置TabBar,支持多个BarItem,TabBar支持小红点显示
  • 支持页面边缘右滑返回

Requirements

  • iOS 8+

Installation with CocoaPods

Podfile

platform :ios, '8.0'

target 'TargetName' do
pod 'PageSegmentView', '~> 1.0.6'
end

Then

$ pod install

Use

init

- (PageSegmentView *)segmentView {
    if (!_segmentView) {
        self.segmentView = [[PageSegmentView alloc]initWithFrame:CGRectMake(0,20,self.view.width,self.view.height - 20)];
        [self.view addSubview:_segmentView];
    }
    return _segmentView;
}

config

self.segmentView.delegate = self;
//可自定义背景色和tab button的文字颜色等
//开始构建UI
[_segmentView buildUI];
//显示红点,点击消失
[_segmentView showRedDotWithIndex:0];

delegate

#pragma mark - PageSegmentView Delegate

- (NSUInteger)numberOfPagers:(PageSegmentView *)view {
    return [_allVC count];
}
- (UIViewController *)pagerViewOfPagers:(PageSegmentView *)view indexOfPagers:(NSUInteger)number {
    return _allVC[number];
}

- (void)whenSelectOnPager:(NSUInteger)number {
    NSLog(@"页面 %lu",(unsigned long)number);
}

Contribution

Discussion and pull requests are welcomed Correcting English grammar is welcomed, too.

Contact me

License

RxTodo is under MIT license. See the LICENSE for more info.