Disabled UIButton not faded or grey

后端 未结 19 1586
死守一世寂寞
死守一世寂寞 2020-12-04 16:11

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.e         


        
19条回答
  •  Happy的楠姐
    2020-12-04 16:28

    You can use the both first answers and is going to be a better result.

    In the attribute inspector (when you're selecting the button), change the State Config to Disabled to set the new Image that is going to appear when it is disabled (remove the marker in the Content->Enabled check to made it disabled).

    And when you change the state to enabled, the image will load the one from this state.

    Adding the alpha logic to this is a good detail.

提交回复
热议问题