在Xcode中,哪个iAction负责检测按钮的释放
我已经为UIBUTTON设置了一个图像。单击此按钮时,将显示突出显示的图像版本。当用户释放按钮时,此突出显示的图像应通过“button.hidden=YES”返回隐藏状态。。问题是我不知道哪个iAction监听按钮的释放。我试过很多,但都没有成功 我正在使用“触地”来检测触摸 从我相信的医生那里在Xcode中,哪个iAction负责检测按钮的释放,xcode,image,uibutton,uiimage,ibaction,Xcode,Image,Uibutton,Uiimage,Ibaction,我已经为UIBUTTON设置了一个图像。单击此按钮时,将显示突出显示的图像版本。当用户释放按钮时,此突出显示的图像应通过“button.hidden=YES”返回隐藏状态。。问题是我不知道哪个iAction监听按钮的释放。我试过很多,但都没有成功 我正在使用“触地”来检测触摸 从我相信的医生那里 UIControlEventTouchUpOutside is the event UIControlEventTouchUpOutside A touch-up event in the con
UIControlEventTouchUpOutside is the event
UIControlEventTouchUpOutside
A touch-up event in the control where the finger is outside the bounds of the control.
Available in iOS 2.0 and later.
Declared in UIControl.h.
试试看
编辑:
要查看您可以对哪些控制状态做出反应,请参阅。
这是如何根据状态控制按钮图像:
[myButton setImage:[UIImage imageNamed:@"button_state_normal"] forState:UIControlStateNormal];
[myButton setImage:[UIImage imageNamed:@"button_state_selected"] forState:UIControlStateSelected];
这样,在用户移除手指后,按钮将返回正常状态。这与IBActions没有任何关系。我尝试使用touchupoutside,但图像不会返回隐藏状态。该图像列在my viewcontroller.h中。。我已经设法把它藏起来了,但没能把它藏起来。我用TouchUpInside激活了按钮的功能。当按钮仍被按下时,将显示高亮显示的按钮(我的图像)。温家宝发布的这张突出显示的图片应该隐藏起来。正是这种效果(隐藏图像)让我无法理解,现在我想我明白你的意思了。请参阅我的更新答案。然而,我现在仍然知道你所说的
是什么意思,我正在使用“触碰”来检测触摸。如果这仍然不能回答您的问题,请添加一些代码。