Ivan Kramarchuk
Ivan Kramarchuk

Reputation: 236

Use Size Classes to resize images on different phones

I wanted to use Use Size Classes to resize UIImage on different phones. Is this possible? Such as to make the image width for 4" iPhone 100p, for 5.5" iPhone 200p without using program code?

Upvotes: 0

Views: 70

Answers (1)

Jelly
Jelly

Reputation: 4522

That is exactly what size classes do. All you have to do is set different size constraints for each size class in storyboard for your image. But unfortunately the devices you specify are in the same size class, see this guidelines. So in this case the only thing you could do is set outlets for your constraints in code, check the device type and update the constraints value programatically based on the device type. See this post on how to get the device type

Upvotes: 1

Related Questions