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?
Asked
Active
Viewed 68 times
1 Answers
1
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
-
I tried to do so, does not help. Maybe I something not so made? https://yadi.sk/i/5RjbIA5DqsHG7 – Ivan Kramarchuk Apr 10 '16 at 06:58
-
You are right it does not work because they are in the same size class. I updated my answer. – Jelly Apr 10 '16 at 07:21