按下暂停按钮后,我希望出现一个标签,直到用户点击屏幕。我该怎么做?
到目前为止我已经有了这个
- (IBAction)ButtonPausePressed:(id)sender {
PauseLabel.hidden = false (//how do i make it only visible until user taps?//)
if (GameEnd != true){
if ([GameUpdate isValid]){
[GameUpdate invalidate];
[BirdUpdate invalidate];
}else{
BirdUpdate = [NSTimer scheduledTimerWithTimeInterval:0.015
target:self
selector:@selector(UpdateBird)
userInfo:nil
repeats:YES];
GameUpdate = [NSTimer scheduledTimerWithTimeInterval:0.025
target:self
selector:@selector(GameUpdate)
userInfo:nil
repeats:YES];
}
}
}
最佳答案
- (IBAction)ButtonPausePressed:(id)sender {
PauseLabel.hidden = false
[self performSelector:@selector(hiddenLabel) withObject:nil afterDelay:3];
...
}
- (void)hiddenLabel{
PauseLabel.hidden = YES;
}
关于objective-c - 按下 UIButton 后 UILabel 显示 3 秒,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22598428/