What's the difference between UIControlStateHighlighted and UIControlStateSelected?

后端 未结 4 1399
没有蜡笔的小新
没有蜡笔的小新 2021-02-05 19:21

I am trying to set a state for UIButton.

But i don\'t know the difference between the UIControlStateHighlighted and UIControlStateSelected.

4条回答
  •  鱼传尺愫
    2021-02-05 19:42

    They can mean whatever you want them to, but in general they mean the following:

    Highlighted = The user is currently interacting with something that will change once they stop interacting (e.g. holding down a button)

    Selected = The item is current the active item in a group (e.g. The selected item in a segmented control). This can only be achieved by setting it programmatically.

提交回复
热议问题