iPhone上导航栏按钮的默认颜色是什么? [英] What is the default color for navigation bar buttons on the iPhone?
问题描述
我在iPhone应用程式的导览列中新增分段控制项。默认情况下,分段控件的颜色与导航栏的颜色匹配。我想将分段控件的颜色与导航栏中的其他按钮(如后退导航按钮)匹配。
I'm adding a segmented control to a navigation bar in my iPhone app. By default the color of the segmented control matches the color of the navigation bar. I want to match the color of the segmented control to other buttons in the navigation bar (like the back navigation button).
任何人都可以告诉我一个RGB值
Can anyone tell me an RGB value (or a system color) that matches the default color of UIButtonBarItems that have been added to a UINavigationBar with a style of UIBarStyleDefault?
推荐答案
之后的UIButtonBarItems的默认颜色匹配UIButtonBarItems的默认颜色同时,我意识到iPhone正在对按钮应用蓝色渐变,所以色调需要非常灰。我终于打了这个HSV组合,这是完美的。请注意,根据文档,所有值都指定为0到1之间的浮点值。
After a while, I realized that the iPhone was applying a blue gradient to the button, so the tint needed to be pretty gray. I finally hit on this HSV combination which is pretty darn perfect. Note that as per the documentation, all values are specified as float values between 0 and 1.
Hue: 0.6
Saturation: 0.33
Value: 0.69
Alpha: 0
我希望这可以为其他一些开发人员节省几个小时的工作。
I hope this saves a couple hours of work for some other developer.
这篇关于iPhone上导航栏按钮的默认颜色是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!