Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed CustomTabBar for iOS5 (issue 13) #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CustomTabBar/Classes/CustomTabBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ - (id) initWithItemCount:(NSUInteger)itemCount itemSize:(CGSize)itemSize tag:(NS
// Set the delegate
delegate = customTabBarDelegate;

// Adjust our width based on the number of items & the width of each item
self.frame = CGRectMake(0, 0, itemSize.width * itemCount, itemSize.height);

// Add the background image
UIImage* backgroundImage = [delegate backgroundImage];
UIImageView* backgroundImageView = [[[UIImageView alloc] initWithImage:backgroundImage] autorelease];
backgroundImageView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleWidth;
backgroundImageView.frame = CGRectMake(0, 0, backgroundImage.size.width, backgroundImage.size.height);
[self addSubview:backgroundImageView];

// Adjust our width based on the number of items & the width of each item
self.frame = CGRectMake(0, 0, itemSize.width * itemCount, itemSize.height);

// Initalize the array we use to store our buttons
self.buttons = [[NSMutableArray alloc] initWithCapacity:itemCount];

Expand Down