简体   繁体   中英

How to contraint the bottom edge and top edge of a view to another view in auto layout ios?

I am trying to place a circular imageview on top of another imageview something like in the picture. Does anyone know how i can achieve it.

在imageview顶部的圆形imageview

In storyboard, you can do it by setting circular image align bottom to image view with half size of your circular image. In my case circular image's height is 100 so, it's half is 50. Please see following image for detail.

在此处输入图片说明

Hope this help!

you should give center vertical constraint and then open constraint property and change first item or second item (as per your requirement) center y to top option Like

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM