简体   繁体   中英

UIView Constraints Settings iOS Storyboard

I want to specify leading, trailing constraints for one of my UIView object. But when I set that I was getting following kind of red warning:

在此处输入图片说明

Details about constraints error:

在此处输入图片说明

Why I was getting this kind of error that is big question in my mind!! I have tried with multiple combination of constraints too because I am aware that constraints always need in combination.

Edit

Set all 4 constraints:

在此处输入图片说明

How can I solve this error?

For the constraints in iOS development, you must define constraints for both side: vertical and horizontal. Like in the picture, you've created only constraints for horizontal side. The XCode requires the vertical side (top, botom, center_vertical, height)

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