<legend id='W3LxD'><style id='W3LxD'><dir id='W3LxD'><q id='W3LxD'></q></dir></style></legend>

    <small id='W3LxD'></small><noframes id='W3LxD'>

    <tfoot id='W3LxD'></tfoot>
  1. <i id='W3LxD'><tr id='W3LxD'><dt id='W3LxD'><q id='W3LxD'><span id='W3LxD'><b id='W3LxD'><form id='W3LxD'><ins id='W3LxD'></ins><ul id='W3LxD'></ul><sub id='W3LxD'></sub></form><legend id='W3LxD'></legend><bdo id='W3LxD'><pre id='W3LxD'><center id='W3LxD'></center></pre></bdo></b><th id='W3LxD'></th></span></q></dt></tr></i><div id='W3LxD'><tfoot id='W3LxD'></tfoot><dl id='W3LxD'><fieldset id='W3LxD'></fieldset></dl></div>

      • <bdo id='W3LxD'></bdo><ul id='W3LxD'></ul>

      如何将 tintColor 应用于 UIImage?

      时间:2023-07-07

      <small id='Ndwt8'></small><noframes id='Ndwt8'>

        <tbody id='Ndwt8'></tbody>

    1. <i id='Ndwt8'><tr id='Ndwt8'><dt id='Ndwt8'><q id='Ndwt8'><span id='Ndwt8'><b id='Ndwt8'><form id='Ndwt8'><ins id='Ndwt8'></ins><ul id='Ndwt8'></ul><sub id='Ndwt8'></sub></form><legend id='Ndwt8'></legend><bdo id='Ndwt8'><pre id='Ndwt8'><center id='Ndwt8'></center></pre></bdo></b><th id='Ndwt8'></th></span></q></dt></tr></i><div id='Ndwt8'><tfoot id='Ndwt8'></tfoot><dl id='Ndwt8'><fieldset id='Ndwt8'></fieldset></dl></div>
    2. <legend id='Ndwt8'><style id='Ndwt8'><dir id='Ndwt8'><q id='Ndwt8'></q></dir></style></legend>
    3. <tfoot id='Ndwt8'></tfoot>
            • <bdo id='Ndwt8'></bdo><ul id='Ndwt8'></ul>

                本文介绍了如何将 tintColor 应用于 UIImage?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我有一个 UIImage 是一个全黑的小符号.UIImage 正在我拥有的自定义 UIButton 子类中设置.是否可以让图像对其应用 tintColor,而不是黑色图像,而是将颜色更改为 tintColor 的任何颜色?

                I have a UIImage that is a small symbol that is all black. The UIImage is getting set in a custom UIButton subclass I have. Is it possible to have the image to apply the tintColor to it, so instead of the black image it changes colors to whatever the tintColor is?

                我只是想避免创建新资产.

                I'm just trying to avoid creating new assets.

                // here I want defaultImageName (that is black) to use the tintColor (that is white)
                [self setImage:[UIImage imageNamed:defaultImageName] forState:UIControlStateNormal];
                

                推荐答案

                如果你只是支持 iOS 7 你可以使用 tintColorUIImageRenderingModeAlwaysTemplate

                If you are just supporting iOS 7 you can use tintColor and UIImageRenderingModeAlwaysTemplate

                这篇文章涵盖了:

                https://www.captechconsulting.com/blogs/ios-7-tutorial-series-tint-color-and-easy-app-theming

                如果您需要支持早期版本,您可能需要考虑这个线程

                If you need to support an earlier version you may want to consider this thread

                如何在iPhone?

                这篇关于如何将 tintColor 应用于 UIImage?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:UIButton 上的左对齐图像和居中文本 下一篇:禁用的 UIButton 不褪色或变灰

                相关文章

                    <bdo id='b2xnA'></bdo><ul id='b2xnA'></ul>

                  1. <i id='b2xnA'><tr id='b2xnA'><dt id='b2xnA'><q id='b2xnA'><span id='b2xnA'><b id='b2xnA'><form id='b2xnA'><ins id='b2xnA'></ins><ul id='b2xnA'></ul><sub id='b2xnA'></sub></form><legend id='b2xnA'></legend><bdo id='b2xnA'><pre id='b2xnA'><center id='b2xnA'></center></pre></bdo></b><th id='b2xnA'></th></span></q></dt></tr></i><div id='b2xnA'><tfoot id='b2xnA'></tfoot><dl id='b2xnA'><fieldset id='b2xnA'></fieldset></dl></div>
                    <tfoot id='b2xnA'></tfoot>

                    <small id='b2xnA'></small><noframes id='b2xnA'>

                  2. <legend id='b2xnA'><style id='b2xnA'><dir id='b2xnA'><q id='b2xnA'></q></dir></style></legend>