0
我嘗試使用下面的代碼沒有任何的運氣定製中的UITabBar一樣定製中的UITabBar一樣:我嘗試使用下面的代碼沒有任何的運氣
這是我的viewDidLoad方法
UIImage *tabBackground = [[UIImage imageNamed:@"tabbar.png"]
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
// Set background for all UITabBars
[[UITabBar appearance] setBackgroundImage:tabBackground];
// Set background for only this UITabBar
[[self.tabBarController tabBar] setBackgroundImage:tabBackground];
有什麼想法,我可能會在這裏出錯?謝謝
你可以在你的代碼中加上這行'NSLog(@「%d」,tabBackground!= nil);'看看打印結果是'0'還是'1'?如果您看到「0」,則程序無法找到圖像。 – dasblinkenlight
@dasblinkenlight控制檯輸出「1」 – hanumanDev
我希望你已經看到這個鏈接http://felipecypriano.com/2012/02/27/how-to-customize-uitabbar-on-ios-5/ –