![](/img/trans.png)
[英]How to automatically change background image of a button after audio stops playing in swift?
[英]Automatically change background image in swift
如何使用計時器自動更改背景圖像,即5秒鍾后一個背景圖像轉換為另一個背景圖像? 您如何在Swift中做到這一點?
NSTimer(timeInterval: 0.5, target: self, selector: "ChangeImage", userInfo: nil, repeats: true)
並在動作中更改圖像,例如
func ChangeImage()
{
NSLog("asdasd");
imgView.image = UIImage(named: "img.png");
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.