【问题标题】:Adding delay to UIButton [duplicate]向 UIButton 添加延迟 [重复]
【发布时间】:2011-09-20 17:24:17
【问题描述】:

可能重复:
How to make a static image appear after 3 seconds?

我希望能够按下按钮,3 秒后它将切换到下一个视图。使用 Objective C、iOS、xcode4。

【问题讨论】:

标签: button view delay


【解决方案1】:

您可以在单击按钮时启动计时器。应该在Button的事件处理函数中实现

NSTimer Class Refernce

【讨论】:

    【解决方案2】:
    [NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(myMethod) userInfo:nil repeats:NO];
    

    ...当然要替换选择器的方法名称。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-09-07
      • 1970-01-01
      • 1970-01-01
      • 2017-10-29
      • 2019-12-15
      • 2023-04-05
      • 1970-01-01
      • 2012-06-25
      相关资源
      最近更新 更多