简体   繁体   中英

Center UIView vertically without relating it to its superview centerY

I have a UIView in a portrait-only app. The view is centered vertically and horizontally with AutoLayout ("manually" using storyboards).

From the XCode IDE, is there any way to express the SAME vertical relation using the Top instead of the Superview.centerY? Can I perfectly center my view vertically another way?

This is the current situation:

在此处输入图片说明

If you want to express the SAME vertical relation using the Top instead of the Superview.centerY, change multiplier to 0.5

在此处输入图片说明

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