Giter Club home page Giter Club logo

pagesegment's Introduction

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.

pagesegment's People

Contributors

haiteng-wang avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.