Skip to content

Instantly share code, notes, and snippets.

@saiday
Created November 10, 2013 06:58
Show Gist options
  • Save saiday/7394795 to your computer and use it in GitHub Desktop.
Save saiday/7394795 to your computer and use it in GitHub Desktop.
UITabBarController disable Title, Image align center
.h
@interface TabViewController : UITabBarController
.m
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super initWithCoder:aDecoder];
if (self) {
NSInteger offset = 7;
UIEdgeInsets imageInset = UIEdgeInsetsMake(offset, 0, -offset, 0);
for (UITabBarItem *item in self.tabBar.items) {
item.imageInsets = imageInset;
}
}
return self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment