Latest 1.0.9
Homepage https://github.com/lafosca/LFSSegmentedBarController
License MIT
Platforms ios 7.0, requires ARC
Authors

Description

LFSSegmentedBarController is a fully customizable tab bar for iOS inspired on Android tab bar. It works with tap gesture on the tabs and scrolling between the tabs.

Usage

LFSSegmentedBarController is inspired on the UITabBarController of native iOS SDK. You can see an example of usage of this controller just below:

LFSSegmentedBarController *tabBarController = [[LFSSegmentedBarController alloc] init];

// We setup all the view controller that will be inside our tab bar controller
FirstViewController *firstViewController = [[FirstViewController alloc] initWithNibName:NSStringFromClass([FirstViewController class]) bundle:nil];
LFSSegmentedBarItem *firstBarItem = [[LFSSegmentedBarItem alloc] initWithTitle:NSLocalizedString(@"Tab 1", nil)];
[firstViewController setSegmentedBarItem:firstBarItem];

SecondViewController *secondViewController = [[SecondViewController alloc] initWithNibName:NSStringFromClass([SecondViewController class]) bundle:nil];
LFSSegmentedBarItem *secondBarItem = [[LFSSegmentedBarItem alloc] initWithTitle:NSLocalizedString(@"Tab 2", nil)];
[secondViewController setSegmentedBarItem:secondBarItem];

ThirdViewController *thirdViewController = [[ThirdViewController alloc] initWithNibName:NSStringFromClass([ThirdViewController class]) bundle:nil];
LFSSegmentedBarItem *thirdBarItem = [[LFSSegmentedBarItem alloc] initWithTitle:NSLocalizedString(@"Tab 3", nil)];
[thirdViewController setSegmentedBarItem:thirdBarItem];

// Setting the view controller will configure all the tab bar properties    
[tabBarController setViewControllers:@[firstViewController, secondViewController, thirdViewController]];

[self.window setRootViewController:tabBarController];

Customizations

This is an example of the fields that are customizable in LFSSegmentedBarController:

LFSSegmentedBarController *tabBarController = [[LFSSegmentedBarController alloc] init];

// Font customizations
[tabBarController setFont:[UIFont systemFontOfSize:17.0]];
[tabBarController setSelectedFont:[UIFont boldSystemFontOfSize:17.0]];

// Line colors and heights
[tabBarController.segmentedControl setHighlightLineHeight:3.0f];
[tabBarController.segmentedControl setLineTintColor:[UIColor whiteColor]];
[tabBarController.segmentedControl setSelectedSectionLineTintColor:[UIColor colorWithRed:0.15f green:0.67f blue:0.86f alpha:1]];

// Text colors
[tabBarController.segmentedControl setTextColor:[UIColor colorWithWhite:0.0f alpha:0.9f]];
[tabBarController.segmentedControl setSelectedTextColor:[UIColor colorWithWhite:0.0f alpha:0.9f]];

// Showing or not showing separator line
[tabBarController.segmentedControl setShowFullWithLine:NO];

TODO

  • Support for landscape mode (by now only works on portrait mode)

Latest podspec

{
    "name": "LFSSegmentedBarController",
    "version": "1.0.9",
    "summary": "iOS implementation of Android Tab Bar",
    "homepage": "https://github.com/lafosca/LFSSegmentedBarController",
    "authors": {
        "David Cortu00e9s": "[email protected]"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE.md"
    },
    "source": {
        "git": "https://github.com/lafosca/LFSSegmentedBarController.git",
        "tag": "1.0.9"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source_files": "lib/*.{h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This