简体   繁体   English

如何使用UIToolbar这样的颜色绘制UIButton

[英]How to draw UIButton with tint color like UIToolbar

I want to customize my button like those UIBarButtonItems on a UIToolbar with tint color. 我想自定义我的按钮,如带有色调颜色的UIToolbar上的那些UIBarButtonItems。 Does any one know how to draw that tint effect? 有谁知道如何产生这种色调效果?

I went nuts trying to figure this out once. 我发疯了,试图一次解决这个问题。

The best I could do was to do my own "custom" button, and use it as the button's "image". 我能做的最好的事情就是做自己的“自定义”按钮,并将其用作按钮的“图像”。

The real hard part was getting the font right. 真正困难的部分是正确设置字体。 The web said it was supposed to be "Helvetica" I believe - but it never looked right. 网上说我相信它应该是“ Helvetica”-但是看起来从来都不对。

The thing you're trying to do isn't supported. 您尝试做的事情不受支持。 You should just make your own button that looks the way you want it to and set it as the customView of the button item object. 您应该只制作自己的按钮,使其外观看起来像您想要的按钮,并将其设置为按钮项对象的customView。

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

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