Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 iOS 7 中,如果我设置工具栏背景颜色,它会使用褪色版本的颜色,而不是实际颜色。起初我以为工具栏可能是半透明的(不是完全不透明的),但这似乎不是问题。
即使使用黑色也只能给我浅灰色。
[topToolbar setBackgroundColor:[UIColor blackColor]];
我也试过:
[topToolbar setTranslucent:NO];
但这只是导致我的工具栏颜色被完全忽略。
任何人都知道如何使它只使用指定的颜色,没有任何怪异?
谢谢。
我以前不知道 setBarTintColor 方法,但它是完成此操作所需要的。
[topToolbar setBarTintColor:[UIColor blackColor]]; [topToolbar setTranslucent:NO];