constrain for uiimageview to keep aspect ratio and expand based on device size

Viewed 4070

i have this problem in 2 projects.Normally, profile image is displayed in circle like

enter image description here

and this is ok for iphone5 size.problem raises on bigger devices.like

enter image description here

as you can see size of profile imageview, it looks small compare to cover image.if i let it increase based on outer image then xocde ignores the aspect ratio constrains which results in non cricular profile imageview

here's current constrains image

enter image description here

any suggestion how should i handle it?

Update here's result if i set constrain on profile imageview to increase with ratio to background image.

enter image description here

asks for y of image view,as i want it to be center so i sets fixed hight = 68 in hopes that xcode will break this constrain to keep aspect ratio, result

enter image description here

so if i remove hight = 68 and add constrain like width.

enter image description here

result

enter image description here

3 Answers
Related