Git Product home page Git Product logo

aktabbarcontroller's Introduction

#AKTabBarController

AKTabBarController is an adaptive and customizable tab bar for iOS.

##Features

  • Portrait and Landscape mode tab bar.
  • Ability to set the height of the tab bar.
  • Ability to hide the tab bar when pushed.
  • Ability to set the minimum height of the tab bar to allow display the title.
  • Ability to hide the title in the tabs.
  • When the height of the tab bar is too small, the title is not displayed.
  • Only one image is needed for both selected and unselected states (style is added via CoreGraphics).
  • Images are resized when needed and particularly in landscape mode.
  • Animated state of the tabs with a nice cross fade animation.

##Usage

Creation and initialization of the tab bar

// Create and initialize the height of the tab bar to 50px.
self.tabBarController = [[AKTabBarController alloc] initWithTabBarHeight:50];

// Adding the view controllers to manage.
[self.tabBarController setViewControllers:[NSMutableArray arrayWithObjects:
                                              [[FirstViewController alloc] init],
                                              [[SecondViewController alloc] init],
                                              [[ThirdViewController alloc] init],
                                              [[FourthViewController alloc] init],nil]];  

Setting the title and image

(in each view controller)

// Setting the image of the tab.
- (NSString *)tabImageName
{
	return @"myImage";
}

// Setting the title of the tab.
- (NSString *)tabTitle
{
	return @"Tab";
}

Setting the minimum height to display the title

[self.tabBarController setMinimumHeightToDisplayTitle:50];

Hide the tab title

[self.tabBarController setTabTitleIsHidden:NO];

Hide the tab bar when pushed in an UINavigationController

When pushing a viewcontroller in the viewControllers stack of an UINavigationController it is possible to hide the tab bar. It works exactely like the original UITabBarController:

[viewController setHidesBottomBarWhenPushed:YES];

For further details see the Xcode example project.

##Requirements

  • iOS >= 4.3
  • ARC
  • QuartzCore.framework

##Screenshots

###iPhone portrait iPhone portrait

###iPhone landscape iPhone portrait

###iPad portrait iPhone portrait

###iPad landscape iPhone portrait

##Todo

  • Ability to set any background pattern.
  • Support different styles (dark, light, etc).

##Credits

  • Largely inspired by Brian Collins's BCTabBarController (for views imbrication).
  • Icons used in the example project are designed by Tomas Gajar (@tomasgajar).

Contact

Ali Karagoz

License

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.