dimanche 28 décembre 2014

iOS: Keeping views proportionally sized to each other using autolayout

I have an UIImageView called 'logo' inside a UIView called 'container'. The logo is centred inside the container both horizontally and vertically.


Depending upon the screen size the app is running in the height of the container changes based on constraints. I would like the size of the logo to change proportionally to the height of the container as on the 3.5 inch display it is too large at its normal size.


Can anyone tell me what constraint I should be placing on the logo and/or container to change the logo's size? I'd love to be able to do this without resorting to code as I believe I should be able to set this up in IB. Many thanks.




Aucun commentaire:

Enregistrer un commentaire