我正在使用 iphone sdk,当用户单击按钮时我必须显示一个标签,但过了一段时间标签 deseapear,我可以这样做吗?
问问题
174 次
1 回答
0
为此使用 NSObject performSelector: withObject: afterDelay:
- 它会设置为您执行选择器的 NSTimer。在按钮单击处理程序中:
...
myLabel.hidden = NO;
[self performSelector:@selector(hideView:) withObject:myLabel afterDelay:3];
...
- (void) hideView:(UIView*)inView{
// You can also add animation here
view.hidden = YES;
}
请注意,不能保证hideView:
会在 3 秒后准确调用。
于 2010-02-19T15:11:53.083 回答