【转】使用autolayout常见错误
2016-06-29 10:47
99 查看
原文网址: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中,否则添加约束的时候就会有警告。把红线圈住的代码移动到箭头所指的地方就行。
使用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中,否则添加约束的时候就会有警告。把红线圈住的代码移动到箭头所指的地方就行。
相关文章推荐
- 算法复杂度速查表
- ubuntu安装g++
- ubuntu安装libstdc++
- maven实战——maven的安装
- AJAX的应用
- 安装libusb
- NFM一些使用工具(2)
- NFM一些实用工具
- 在linux中命令后面带参数“-”与“--”有什么不同
- NFM System Configuration
- 测试NFM
- 模拟器反应特别慢 - 打印输出Simulator slow-motion animations are now on
- 一个周完成dxf文件的解析
- c#传入域名返回对应的IP
- AD9 如何画4层pcb板
- 添加索引 两种方式,ios新手总结篇
- Sublime Text3解决打开文件乱码问题
- 2015全国博士生学术论坛(测绘科学与技术)
- 内存映射文件机制处理大文件
- 一些题目小结6.29