2012-04-10 98 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