DKTabView 0.2.1

DKTabView 0.2.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Jun 2018

Maintained by Drinking pan.



DKTabView 0.2.1

  • By
  • drinking

DKTabView

CI Status Version License Platform

Demo

Platform

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Here's how to create a custom tab view.

    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];

Installation

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

pod "DKTabView"

Author

drinking, [email protected]

License

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