我有一个 UIButton,使用此代码根据突出显示的状态设置图像:
UIImage *buttonImage = imageForButton(CGSizeMake(SquarePanelSize.width, SquarePanelSize.height), NO);
UIImage *buttonHighlightedImage = imageForButton(CGSizeMake(SquarePanelSize.width, SquarePanelSize.height), YES);
[self.addButton setImage:buttonImage forState:UIControlStateNormal];
[self.addButton setImage:buttonHighlightedImage forState:UIControlStateHighlighted];
问题是我希望它在用户将手指放在它上面时保持突出显示,但它会在一秒钟后恢复正常。