我正在开发一个使用 UIButton 的 ios 项目。我用过[cardButton setTitle:card.contents forState:UIControlStateSelected|UIControlStateDisabled];
但我不完全了解机制。我知道这是 emun 和位掩码过程。任何人都可以向我解释一下吗?谢谢。
enum {
UIControlStateNormal = 0,
UIControlStateHighlighted = 1 << 0,
UIControlStateDisabled = 1 << 1,
UIControlStateSelected = 1 << 2,
UIControlStateApplication = 0x00FF0000,
UIControlStateReserved = 0xFF000000
};