DKTabView 0.2.1

DKTabView 0.2.1

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
发布最新发布2018年6月

Drinking pan 维护。



DKTabView 0.2.1

  • drinking

DKTabView

CI Status Version License Platform

示例

Platform

使用方法

要运行示例项目,请克隆仓库,然后首先从 Example 目录运行 pod install 命令。

以下是如何创建自定义标签视图。

    DKTabView *tabView = [[DKTabView alloc] initWithFrame:CGRectMake(0, 120, CGRectGetWidth(self.view.frame), 44)];
    tabView.layoutStyle = DKTabFillParent;
    tabView.cursorStyle = DKTabCursorUnderneath;
    tabView.backgroundColor = [UIColor whiteColor];
    tabView.cursorView.backgroundColor = [UIColor blackColor];

    // This method should be invoked at the last step
    [tabView buildTabViewWithItems:^NSArray * {
        NSArray * titles = @[@"NEWS", @"CULTURE", @"BOOKS", @"BUSINESS"];
        NSMutableArray *items = [[NSMutableArray alloc] init];
        for (NSString *title in titles) {
            UILabel *label = [[UILabel alloc] init];
            label.text = title;
            label.font = [UIFont systemFontOfSize:14];
            label.textColor = [UIColor blackColor];
            label.textAlignment = NSTextAlignmentCenter;
            [items addObject:label];
        }
        return items;
    }];

    [self.view addSubview:tabView];

安装

DKTabView 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中

pod "DKTabView"

作者

drinking,[email protected]

许可

DKTabView可在MIT许可证下使用。有关更多信息,请参阅LICENSE文件。