<tfoot id='vozPL'></tfoot>

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

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

      <legend id='vozPL'><style id='vozPL'><dir id='vozPL'><q id='vozPL'></q></dir></style></legend>
        <bdo id='vozPL'></bdo><ul id='vozPL'></ul>

      UIButton:为选中状态设置图片

      时间:2023-07-09
      <legend id='XZq6h'><style id='XZq6h'><dir id='XZq6h'><q id='XZq6h'></q></dir></style></legend>

        <tbody id='XZq6h'></tbody>

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

              • <tfoot id='XZq6h'></tfoot>
                本文介绍了UIButton:为选中状态设置图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我为按钮的状态 Normal、Highlighted 和 Selected 设置了图像,但是当按钮处于选定状态并按下/突出显示它时,我没有看到突出显示的图像,而只是看到灰色的图像.选择按钮时是否可以设置图像为高亮状态?

                I set an images for button's states Normal,Highlighted and Selected, but when the button in selected state and I press/highlight it I didn't see my highlighted image but just grayed picture. Is it possible to set an image for highlighted state when the button selected?

                我的代码:

                [button setImage:[UIImage imageNamed:@"normal.png"] forState:UIControlStateNormal];
                [button setImage:[UIImage imageNamed:@"pressed.png"] forState:UIControlStateHighlighted];
                [button setImage:[UIImage imageNamed:@"checked.png"] forState:UIControlStateSelected];
                

                当我这样做时:

                [button setSelected:YES];
                

                然后按下按钮,pressed.png"图像不会被选中.

                and press the button, the "pressed.png" image doesn't select.

                推荐答案

                我找到了解决办法:需要添加添加行

                I found the solution: need to add addition line

                [button setImage:[UIImage imageNamed:@"pressed.png"] forState:UIControlStateSelected | UIControlStateHighlighted];
                

                这篇关于UIButton:为选中状态设置图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:从 UIColor 创建 UIImage 以用作 UIButton 的背景图像 下一篇:触摸后保持 UIButton 处于选中状态

                相关文章

              • <tfoot id='ZN0g7'></tfoot>

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

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

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

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