我爲我的UIToolBar設置了tintcolor。它在ios 6.0中正確顯示,但在ios 5.0模擬器上顯示爲黑色。我的代碼在這裏UIToolbar在ios 5.0和ios 6.0上顯示不同的顏色模擬器
originalBounds = mysearchBarBarItem.customView.bounds;
mySearchBar.bounds = CGRectMake(0,0,215,44);
myTopToolbar.tintColor = [UIColor colorWithPatternImage:[UIImage imageNamed:NAVIGATION_BAR_BACKGROUND]];
myTopToolbar.barStyle = UIBarStyleDefault;
mySearchBar.barStyle = UIBarStyleDefault;
mySearchBar.tintColor = [UIColor colorWithPatternImage:[UIImage imageNamed:NAVIGATION_BAR_BACKGROUND]];
[myTopToolbar setItems:toolBarItemsArray animated:YES];
您是否在設備中檢查過? – thavasidurai
我已經在真實的iOS 6.0硬件中檢查了它,它顯示正確。我沒有iOS 5.0真實設備進行測試。我已經測試了它iOS 5.0模擬器 – Harikrishnan