UIButton: set image for selected-highlighted state

后端 未结 15 2796
花落未央
花落未央 2020-11-28 19:23

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 j

15条回答
  •  生来不讨喜
    2020-11-28 19:37

    Correct me if I am wrong. By doing

       [button setSelected:YES];
    

    you are clearly changing the state of the buttons as selected. So naturally by the code you have provided the image will that for the selected state in your case checked.png

提交回复
热议问题