我尝试在 UIToolbar
上设置 Bar Tint Color(在 Interface Builder 中),该 translucent
设置为关闭。无论我选择什么颜色,工具栏在模拟器中总是白色的(它在 IB 中改变颜色)。我需要将 translucent 设置为 true 以使我的 UIToolbar
具有正确的 Bar Tint。在 Apple 文档中,我没有看到任何地方提到当 translucent
设置为 false 时 barTintColor
不工作。
谢谢
编辑
看起来这只是界面生成器中的问题,在代码中设置 Bar Tint Color 是有效的,任何人都可以确认吗?
最佳答案
来自文档
If you set this property to NO on a toolbar with a translucent custom background image, the toolbar provides an opaque background for the image using black if the toolbar has UIBarStyleBlack style, white if the toolbar has UIBarStyleDefault, or the toolbar’s barTintColor if a custom value is defined.
关于ios - 半透明为 false 时 UIToolBar 上的 Bar Tint,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31331012/