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

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

    <tfoot id='tp7Qy'></tfoot>
        <bdo id='tp7Qy'></bdo><ul id='tp7Qy'></ul>

    1. <legend id='tp7Qy'><style id='tp7Qy'><dir id='tp7Qy'><q id='tp7Qy'></q></dir></style></legend>
    2. 禁用的 UIButton 不褪色或变灰

      时间:2023-07-07
        • <bdo id='RwRM0'></bdo><ul id='RwRM0'></ul>

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

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

                <tbody id='RwRM0'></tbody>
              • <tfoot id='RwRM0'></tfoot>

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

                本文介绍了禁用的 UIButton 不褪色或变灰的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                在我的 iPhone 应用程序中,我有一个在 Interface Builder 中创建的 UIButton.我可以像这样在我的代码中成功启用和禁用它...

                In my iPhone app, I have a UIButton which I have created in Interface Builder. I can successfully enable and disable it like this in my code ...

                sendButton.enabled = YES;
                

                sendButton.enabled = NO;
                

                但是,按钮的视觉外观始终相同!它不会褪色或变灰.如果我尝试单击它,它会按预期启用或禁用.我错过了什么吗?它不应该看起来褪色或变灰吗?

                However, the visual look of the button is always the same! It is not faded or grey. If I attempt to click it though, it is enabled or disabled as expected. Am I missing something? Shouldn't it look faded or grey?

                推荐答案

                可以使用如下代码:

                sendButton.enabled = YES;
                sendButton.alpha = 1.0;
                
                or
                
                sendButton.enabled = NO;
                sendButton.alpha = 0.5;
                

                这篇关于禁用的 UIButton 不褪色或变灰的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:如何将 tintColor 应用于 UIImage? 下一篇:如何在分段控制按钮中永久取消选择分段,直到再次单击它

                相关文章

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

                  1. <small id='90Zaw'></small><noframes id='90Zaw'>