Common errors with AutoLayout

Source: Internet
Author: User

Common errors with AutoLayout

1:the view hierarchy isn't prepared for the constraint: <nslayoutconstraint:0x8e82e40 uisearchbar:0x8e7fa80.top = = UIV Iew:0x8b7c510.top + 20>
When added to a view, the constraint ' s items must is descendants of that view (or the view itself). This would crash if the constraint needs to being resolved before the view hierarchy is assembled. Break on-[uiview _viewhierarchyunpreparedforconstraint:] to Debug.

This error is to be added to the current view immediately after creating the Searchbar, otherwise there will be a warning when the constraint is added. Move the code circled by the red line to the point where the arrow is pointing.

Common errors with AutoLayout

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.