zoukankan      html  css  js  c++  java
  • 【转】使用autolayout常见错误

    原文网址:http://www.cnblogs.com/xiaokanfengyu/p/4175091.html

    使用autolayout常见错误

    1:The view hierarchy is not prepared for the constraint: <NSLayoutConstraint:0x8e82e40 UISearchBar:0x8e7fa80.top == UIView:0x8b7c510.top + 20>
        When added to a view, the constraint's items must be descendants of that view (or the view itself). This will crash if the constraint needs to be resolved before the view hierarchy is assembled. Break on -[UIView _viewHierarchyUnpreparedForConstraint:] to debug.

    这个错误是创建完searchBar以后要马上添加到当前view中,否则添加约束的时候就会有警告。把红线圈住的代码移动到箭头所指的地方就行。

  • 相关阅读:
    CAS简介
    Volatile的3大特性
    dsf对矩阵进行搜索
    JVM
    REST风格
    自定义Starters(自动配置Bean)
    反射和注解的原理
    mybatis的注解开发
    Java的多线程安全
    mybatis(3)
  • 原文地址:https://www.cnblogs.com/wi100sh/p/5626037.html
Copyright © 2011-2022 走看看