【问题标题】:How to delay to load the button on image view in iphone如何延迟在iphone的图像视图上加载按钮
【发布时间】:2011-02-10 13:35:23
【问题描述】:

我是 iphone 开发新手。我创建了一个视图控制器并在视图上设置了按钮。单击按钮时,它导航到下一个视图并在视图中加载图像。现在我想在加载图像后显示按钮。该按钮将在 3 秒后显示在图像视图上。

请帮帮我,

谢谢。

【问题讨论】:

    标签: iphone image button


    【解决方案1】:

    您需要使用NSTimer。

    当视图加载时,将计时器设置为 3 秒,并将其配置为调用视图控制器的自定义方法。该方法应该将按钮添加到视图中。

    【讨论】:

      【解决方案2】:

      使用 NSTimer

      在 viewDidLoad 中

      [NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(updateCounter:) userInfo:nil repeats:NO];
      

      创建一个“updateCounter”自定义方法来显示按钮

      - (void)updateCounter:(NSTimer *)theTimer {
      
      display the button here...
      }
      

      一切顺利。

      【讨论】:

        猜你喜欢
        • 2013-11-09
        • 1970-01-01
        • 1970-01-01
        • 2020-08-12
        • 2023-03-07
        • 1970-01-01
        • 2018-01-28
        • 1970-01-01
        • 2021-04-02
        相关资源
        最近更新 更多