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

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

    • <bdo id='DkNJK'></bdo><ul id='DkNJK'></ul>
  1. <small id='DkNJK'></small><noframes id='DkNJK'>

      禁用 UIButton 时避免使其透明/透视

      时间:2023-07-07
    1. <tfoot id='0jCFt'></tfoot>
        <legend id='0jCFt'><style id='0jCFt'><dir id='0jCFt'><q id='0jCFt'></q></dir></style></legend>

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

              <small id='0jCFt'></small><noframes id='0jCFt'>

              1. 本文介绍了禁用 UIButton 时避免使其透明/透视的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我想禁用我的 UIButton,所以我打电话:

                I want to disable my UIButton, so I call:

                button.enabled = FALSE;
                

                但是,这使按钮透明,我可以看到它下面的元素.我不介意它改变颜色,我只是不希望它被透视.

                However this makes the button see-through and I can see the elements underneath it. I don't mind that it changes colour, I just don't want it to be see-through.

                我尝试在 IB 中勾选不透明"和剪辑子视图"框,但没有任何乐趣.

                I've tried ticking the boxes for 'opaque' and 'clip subviews' in IB, but no joy.

                有没有简单的方法来解决这个问题?我想我可以在其后面放置一个带有相同按钮图像的 UIImageView,但这并不是一个优雅的解决方案.

                Is there an easy way to fix this? I suppose I could put a UIImageView with the same button image behind it, but it's hardly an elegant solution.

                推荐答案

                试试userInteractionEnabled属性:

                button.userInteractionEnabled = NO;
                

                这篇关于禁用 UIButton 时避免使其透明/透视的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:以编程方式更改标题在 IB 中设置为属性的 UIButton 的标题 下一篇:UIButton - 触摸更改图像

                相关文章

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

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