I am projecting my app's screen onto another screen and noticed the images in my app's buttons look slightly blurry on the external screen. I would like to use the same image except manually use its @2x or @3x image size when I know my screen is projecting.
I have searched around and not found a great answer, can this be done programmatically in Swift?
Make a UITraitCollection whose displayScale
is 2 or 3, as desired.
init(displayScale:)
Now use that trait collection, or a combination of the current trait collection with that trait collection, to fetch that variety of your image from the asset collection.
init(named:in:compatibleWith:)
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.