简体   繁体   English

在UISegmentedControl中控制色调颜色

[英]Control tint color in UISegmentedControl

In most of my projects a UX designer will provide me a RGB color for an asset in iOS, but am having trouble providing what is needed for a tint color in a control. 在我的大多数项目中,UX设计人员将为我在iOS中为资产提供RGB颜色,但在控件中提供淡色所需的内容时遇到了麻烦。 To explain, since the tint ends up being a wide range of colors on the control, when the designer says this color, where does the given color end up being in the gradient? 解释一下,由于色调最终会成为控件上的多种颜色,所以当设计人员说出这种颜色时,给定的颜色最终会出现在渐变中的哪个位置?

And, do we have any control over the gradient range? 而且,我们可以控制渐变范围吗?

If you are trying to get a custom gradient going, you might be better off having your designer give you some small PNGs of it and use setBackgroundImage:forState:barMetrics: to customize the appearance. 如果要尝试使用自定义渐变,最好让设计人员为其提供一些小PNG,然后使用setBackgroundImage:forState:barMetrics:来定制外观。

See the UICatalog sample project that comes with XCode. 请参阅XCode随附的UICatalog示例项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM