I like the watch icon you get when you use storyboard to add a UIIMAGEVIEW and set its Image attribute to the built-in "applewatch" icon.
But when I programmatically create a UIIMAGEVIEW how can I set it to that cool icon?
Here I add a 3rd party.png of a wrist band. But I want to use the built-in which looks best:
let imageName = "Wrist Band.png"
let image = UIImage(named: imageName)
let imageView = UIImageView(image: image!)
imageView.frame = CGRect(x: 0, y: 0, width: 100, height: 200)
view.addSubview(imageView)
You seem to be talking about the SF symbol applewatch
. You can get that (or any other SF symbol) by using UIImage(systemName:)
:
UIImage(systemName: "applewatch")
Notes:
tintColor
of the image view
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.