【问题标题】:Automatically change background image in swift快速自动更改背景图像
【发布时间】:2014-11-12 08:05:49
【问题描述】:

如何使用计时器自动更改背景图片,即 5 秒后,一张背景图片转换为另一张?你如何在 Swift 中做到这一点?

【问题讨论】:

    标签: ios image swift background


    【解决方案1】:
     NSTimer(timeInterval: 0.5, target: self, selector: "ChangeImage", userInfo: nil, repeats: true)
    

    并在行动中改变形象

     func ChangeImage()
    {
        NSLog("asdasd");
        imgView.image = UIImage(named: "img.png");
    }
    

    【讨论】:

      猜你喜欢
      • 2016-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-04
      • 1970-01-01
      • 1970-01-01
      • 2016-12-02
      • 2016-01-15
      相关资源
      最近更新 更多