App Source Code for Sale

or

Author

mobilebricks

iOS > Full Applications

ALTabsView

Overview

ALTabsView is a component that will enable browser-like tabs functionality, for your apps.

It is composed by a collection of tabs, and for each you can customize:

  • The icon on the left

  • The close button on the right

  • The title label in the middle

With the appropriate methods you can customize: the background images, the size of the tabs and every single element inside the tabs; you can do that with the global methods (set the tabs parameters directly from the ALTabsView instance) or you can setup different parameters for each specific tab.

Moreover, there are four delegate methods which advise when a tab will/did close or when will/did become selected.

Sample Code

This code shows how to create and add the ALTabsView to a ViewController

ALTabsView *tabs=[[ALTabsView alloc] initWithFrame:CGRectMake(0, 0, 292, 50)];
tabs.tabsViewDelegate=self;
[tabs setTabsViewBackgroundImage:[UIImage imageNamed:@"bg.png"]];
//customize every single tab background. It will be a stretchable image for flexible width.
[tabs setTabsTabImageBackgroundSelected:[[UIImage imageNamed:@"selected.png"] stretchableImageWithLeftCapWidth:20 topCapHeight:15]];
[tabs setTabsTabImageBackgroundNormal:[[UIImage imageNamed:@"normal.png"]stretchableImageWithLeftCapWidth:11 topCapHeight:11]];
//Customize title
[tabs setTabsFont:[UIFont boldSystemFontOfSize:13]];
[tabs setTabsLabelTextColor:[UIColor colorWithRed:0.496 green:0.586 blue:0.451 alpha:1.000]];

//set general tab layout settings
tabs.closeSize=CGSizeMake(35, 35);
tabs.iconSize=CGSizeMake(20, 20);
tabs.horizontalLabelMargin=3;
tabs.verticalCloseMargin=8;
tabs.horizontalCloseMargin=0;
tabs.labelHeight=20;

//Adds the first tab
[tabs addTabWithTitle:@"Browser" andIconImage:[UIImage imageNamed:@"close.png"]];
[tabs setTabsCloseImage:[UIImage imageNamed:@"close.png"]];

[self.view addSubview:tabs];

This code show one of the delegate methods. In this case we change the text color according to the tab selection state.

-(void) tabsView:(ALTabsView *)tabsView didSelectTabAtIndex:(int)index{
    for (SingleTab* tab in tabsView.tabsCollection){
        if (tab.selected) 
            tab.titleLabel.textColor=[UIColor colorWithWhite:0.200 alpha:1.000];
        else
            tab.titleLabel.textColor=[UIColor colorWithWhite:0.800 alpha:1.000];
    }
}
Single App License $19.00
Download
Multiple App License $119.99
Download
0 comment Do you like this product? Have any Questions? Post a Comment. Leave a comment

More item by mobilebricks

ALPopupView
$19.00
5.00 (1 votes)
by mobilebricks
ALNavigationController
$19.00
5.00 (1 votes)
by mobilebricks
ALToolbar
$19.00
5.00 (1 votes)
by mobilebricks