【问题标题】:Tint UIButton's image from interface builder with UIImageRenderingModeAlwaysTemplate使用 UIImageRenderingModeAlwaysTemplate 从界面生成器中为 UIButton 的图像着色
【发布时间】:2014-09-28 14:53:56
【问题描述】:

我有一个UIButtonimage 属性,我是从界面生成器中设置的。我希望这张图片用 superview 的tintColor 着色。通过代码,我可以将图像的渲染模式设置为UIImageRenderingModeAlwaysTemplate,但是如何从界面生成器中做到这一点?

【问题讨论】:

    标签: ios objective-c uibutton interface-builder


    【解决方案1】:

    看了一会儿就知道了。我在 IB 中自定义了按钮类型,但现在将其切换为系统类型使用 UIButtonimage 的模板呈现模式。

    【讨论】:

    • 感谢您跟进您自己的问题!
    • 喜欢[UIButton buttonWithType:UIButtonTypeSystem];
    • 非常感谢您的跟进 - 这对我很有帮助。
    猜你喜欢
    • 2011-10-07
    • 1970-01-01
    • 2012-03-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-06
    • 1970-01-01
    • 2012-01-31
    相关资源
    最近更新 更多