我花了大約一個小時試圖弄清楚爲什麼我的BarTintColor在UINavigation欄中沒有改變。我猜你不能使用RGB來設置BarTintColor?有沒有解決方法?我想要能夠控制顏色。UINavigationBar BarTintColor不能使用RGB值
更新:
OK kambla幫了我很多。我把我的應用程序代理以下在
NSUInteger r = 228, g = 228, b = 228;
UIColor *color =
[UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:0];
[[UINavigationBar appearance] setBarTintColor:color];
return YES;
我證實,該代碼被執行「applicationdidFinishLaunchingWithOptions」的尾部。但我的導航欄上的色調不變?
顯示你的代碼和閱讀'UIColor'文檔讓您瞭解它預計值。 – rmaddy
'alpha:0'表示您創建一個完全透明的顏色(即不可見)。請注意,在我的答案中,我使用了alpha值「1.0」(完全不透明/不透明)。 – kambala
我的錯誤。我試過alpha 1.0,它是一樣的。沒有什麼變化。我很難過。 –