Latest 0.1.0
Homepage https://github.com/zhigangwu/ZGPageMenu
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

Installation

ZGPageMenu is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'ZGPageMenu'

Tutorial

#import "ZGScrollView.h"
ZGScrollView *scrollView = [[ZGScrollView alloc] initWithFrame:<#(CGRect)#>];
scrollView.dataArray = @[@"标题1",@"标题2",@"标题3",@"标题4"];
// 设置默认字体颜色
scrollView.defaultColor = UIColor.lightGrayColor;

// 设置选中项字体颜色
scrollView.selectedtColor = UIColor.blackColor;

// 设置当前默认选中栏
scrollView.currentPage = 0;

// 设置下滑线的宽度 高度 颜色 
[scrollView customizeUnlineWidth:50 setUnlineHeight:2 setUnlineColor:UIColor.blackColor];

默认的字体颜色设置一定要优于设置当前的选择页,不然没有效果

// 下划线的改变类型 一共提供了五中变化类型 
scrollView.changeStyle = UICollectionViewCellChangeStyleDefaultStyle;

typedef NS_ENUM(NSInteger, UICollectionViewCellChangeStyle) {
    UICollectionViewCellChangeStyleDefaultStyle,        // 默认样式
    UICollectionViewCellChangeStyleSynchronizeStyle,    // 同步
    UICollectionViewCellChangeStyleMovingStyle,         // 移动
    UICollectionViewCellChangeStyleIndentationStyle,    // 缩进
    UICollectionViewCellChangeStyleCrawlStyle           // 爬行
};

UICollectionViewCellChangeStyleDefaultStyle 默认

default

UICollectionViewCellChangeStyleSynchronizeStyle 同步

Synchronize

UICollectionViewCellChangeStyleMovingStyle 移动

Moving

UICollectionViewCellChangeStyleIndentationStyle 缩进

Indentation

UICollectionViewCellChangeStyleCrawlStyle 爬行

Crawl

// 添加相应的子视图
[self addChildView];

- (void)addChildView {
    Humanity_ViewController *humanity = [[Humanity_ViewController alloc] init];
    [self addChildViewController:humanity];

    Undead_ViewController *undead = [[Undead_ViewController alloc] init];
    [self addChildViewController:undead];

    ...

// 添加子视图到数组中
    NSMutableArray *mutablearray = [NSMutableArray arrayWithObjects:humanity,undead,nil];

//  添加子视图数组到 scrollView 中
    [scrollView addChildrenController:mutablearray];
}

Author

Ryan, [email protected], [email protected],Blog

License

ZGPageMenu is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "ZGPageMenu",
    "version": "0.1.0",
    "summary": "ZGPageMenu summary",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "https://github.com/zhigangwu/ZGPageMenu",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "[email protected]": "[email protected]"
    },
    "source": {
        "git": "https://github.com/zhigangwu/ZGPageMenu.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "ZGPageMenu/Classes/**/*"
}

Pin It on Pinterest

Share This