Latest 1.0.0
Homepage https://github.com/huhanze/HBTabView
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit
Authors

1.说明: 一款轻量级的TabView, 类似于新闻主页的联动视图以及分类显示的tab等UI可使用。

效果 :

HBTabView
              
HBTabView

2. 引入库

2.1 cocoapods引入

在podfile文件中添加

    pod 'HBTabView', '~> 1.0.0'

2.2 手动导入

下载demo,将demo中的HBTabViewLib文件夹拖拽到工程中即可

3. 使用方式

3.1 创建tabView

两种样式,水平布局和垂直布局

typedef NS_ENUM(NSUInteger, HBTabViewShowType) {
    HBTabViewShowTypeHorizontal = 0,
    HBTabViewShowTypeVertical   = 1,
    HBTabViewShowTypeDefault    = HBTabViewShowTypeHorizontal,
};
HBTabView *tabView = [[HBTabView alloc] initWithFrame:CGRectMake(0, 0, kTabViewWidth, kTabViewHeight) parentViewController:self showType:HBTabViewShowTypeHorizontal];

3.2 添加指定的控制器

    Test01ViewController *test01VC = [[Test01ViewController alloc] init];
    [tabView addItemWithTitle:@"测试1" containerViewWithViewController:test01VC];

    Test02ViewController *test02VC = [[Test02ViewController alloc] init];
    [tabView addItemWithTitle:@"测试2" containerViewWithViewController:test02VC];

    Test03ViewController *test03VC = [[Test03ViewController alloc] init];
    [tabView addItemWithTitle:@"测试3" containerViewWithViewController:test03VC];

    Test04ViewController *test04VC = [[Test04ViewController alloc] init];
    [tabView addItemWithTitle:@"测试4" containerViewWithViewController:test04VC];

    Test01ViewController *test05VC = [[Test01ViewController alloc] init];
    [tabView addItemWithTitle:@"测试5" containerViewWithViewController:test05VC];

    Test02ViewController *test06VC = [[Test02ViewController alloc] init];
    [tabView addItemWithTitle:@"测试6" containerViewWithViewController:test06VC];

    Test03ViewController *test07VC = [[Test03ViewController alloc] init];
    [tabView addItemWithTitle:@"测试7" containerViewWithViewController:test07VC];

    Test04ViewController *test08VC = [[Test04ViewController alloc] init];
    [tabView addItemWithTitle:@"测试8" containerViewWithViewController:test08VC];

    Test01ViewController *test09VC = [[Test01ViewController alloc] init];
    [tabView addItemWithTitle:@"测试9" containerViewWithViewController:test09VC];

    Test02ViewController *test010VC = [[Test02ViewController alloc] init];
    [tabView addItemWithTitle:@"测试10" containerViewWithViewController:test010VC];

3.3 显示Tab

[tabView show];

说明: 非常轻量级的,使用过程就这么简单。

注:每个tab的联动的View(ViewController)都可以是独立的,互不影响。
indicator的颜色可以自己设置,选中的标题颜色均可设置。

Latest podspec

{
    "name": "HBTabView",
    "version": "1.0.0",
    "summary": "u4e00u6b3eu8f7bu91cfu7ea7u7684TabView",
    "homepage": "https://github.com/huhanze/HBTabView",
    "license": "MIT",
    "authors": {
        "huhaibo": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/huhanze/HBTabView.git",
        "tag": "v1.0.0"
    },
    "source_files": "HBTabView/HBTabView/HBTabViewLib/**/*.{h,m}",
    "frameworks": "UIKit",
    "requires_arc": true
}

Pin It on Pinterest

Share This