How iOS removes the default constraint

Source: Internet
Author: User

Application scenario, have you ever tried to define a control that is xib in AutoLayout, and then connected the outlet. Following the code to set the constraints on the control, but found that the effect is not displayed, the console print out the constraints of the problem.
This is probably the case: IB Auto generated at build time to view with fixed frame


Cause resolution: Because you set up a AutoLayout, but you do not have a custom, the system will help you to automatically create some constraints

Workaround:
Define some constraints yourself in xib, and then tick "placeholder remove at build time" in the properties panel of Xib


Ask me why know this question, hehe, Google Bar, with the address of the foreign great God: http://travisjeffery.com/b/2013/11/ preventing-ib-auto-generated-at-build-time-for-view-with-fixed-frame/

How iOS removes the default constraint

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.