简体   繁体   中英

Constraints Issue with Xcode

When I run the program in the simulator. It only show part of something. Am I doing something wrong with my constraints?

在此处输入图片说明

在此处输入图片说明

What ever the constraints you set are wrong to keep content in middle. because take the 4s case in width 320 px you if you are giving left and right to 100px, So your play area will be only 120 (320 - 100 - 100). So if you want them aligned in middle you can add NSLayoutAttributeCenterX . Also when you add height, Top, Bottom constraints all your views are in relationship with its super view.. but view can also be in relationship with siblings.

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