2012-04-10 44 views
0

我必须自定义tabbar项目中的图像以在我的图标中插入图像,我该怎么办? 我从我的朋友那里听说,我应该创建一个新的xib并将其用于定制一个新的tabbar项目。 这是真的吗?如何定制UITABBAR IOS 5.0?

非常感谢!

+0

看看这些样品定制tabbar items – 2012-04-10 11:43:36

+0

chec k出答案在这里它可能是你的解决方案http://stackoverflow.com/questions/9976839/how-to-set-uitabbarcontroller-to-view/9977322#9977322 – Hiren 2012-04-10 11:43:42

回答

0

只是把下面的方法

appdelegate.m

文件

- (void)customizeAppearance 

{ 

// Costomise UITabBar 

// Note you can also specify “finished” and “unfinished” images if you wish to modify the manner in which the selected & unselected images appear. 

UIImage *tabBackground = [[UIImage imageNamed:@"tab_bg"]resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; 

[[UITabBar appearance] setBackgroundImage:tabBackground]; 

[[UITabBar appearance] setSelectionIndicatorImage:[UIImage imageNamed:@"tab_select_indicator"]]; 

} 

这可能会帮助你 Please find much more on this site