ios - UITableHeaderView 使用 Autolayout 如何使内容自适应
阿神
阿神 2017-04-17 16:49:22
0
1
457

我想让内容自动填充 UITableHeaderView, 使得其高度能够随着内容的变化而变化。但是,如果我直接设置 UITableHeaderView 为 translatesAutoresizingMaskIntoConstraints = NO 会报错 "Assertion failure in -[UITableView layoutSublayersOfLayer:]"。 如果不设置改属性,约束布局会出错 “Unable to simultaneously satisfy constraints.” 该如何解决,或者有没有更好的实现目标的解决方案?谢谢。

阿神
阿神

闭关修行中......

reply all(1)
PHPzhong

After changing the content, call setNeedLayout and layoutIfNeed, and get the frameview.frame = frame给tableView.tableHeaderView重新赋值这样tableView.tableHeaderView = view.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!