I am new in auto layouts and assets of images. I am confused that image view height and width I have to set fix or according to superview, will it effect on resolution or not.
I have a image view 40x40. And I have assets of images are 1x = 72x72, 2x = 96x96, 3x = 144x144. I have to set image for all devices with good resolution, and I want width and height according to Superview. What constraint do I have to use and how can I get good resolution for all devices?
Is Adaptive Layout necessary to use? I mean Autolayouts for Assets?
解决方案
Give only these constraints for UIViewImage:
vertically centre to superView(Multiplier if needed)
horizontally centre to superView(Multiplier if needed)
height wrt superView.height(Multiplier for the constraint)
aspect ratio to itself