简体   繁体   中英

How to set background image of SVProgressHUD Loader - IOS Swift

I am using SVProgressHUD Loader. I want to use background image of loader. For that I don't have any clue that how to use this.

My code is this:

SVProgressHUD.setMinimumSize(CGSize(width: 120, height: 120));
SVProgressHUD.setBackgroundColor(UIColor.darkGray)
SVProgressHUD.setRingNoTextRadius(40)
SVProgressHUD.setForegroundColor(UIColor.white)
SVProgressHUD.show()

I used this code but getting the error: SVProgressHUD.setInfoImage("test_icon.png") -> error is : Cannot convert value of type 'String' to expected argument type 'UIImage'

I am Newbie on IOS development. Any suggestion is really appreciated.

您可以通过以下方式使用图片:

SVProgressHUD.setInfoImage(UIImage(named: "your_image_name")!)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM