相关疑难解决方法(0)

UIStackView:从xib加载视图和更新subView的高度约束没有反映任何变化?

我的应用程序中有以下层次结构

- UIScrollView
- UIStackView
 - UIView 1  // load with xib and added in arrangedSubviews
   - UIScrollView 1.1 // horizontal scrolling, fixed height constraint 38
   - UIView 1.2 // called it childView. has fixed height 0 (I load the view from xib and add it here dynamically and update its height)
     - UIView 1.2.1 // called it New View
 - UIView 2
 - UIView 3
Run Code Online (Sandbox Code Playgroud)

所以我的问题是当我从xib加载一个视图并将其添加到UIView1.2也增加了高度约束0到新添加的子视图的高度但是什么都不会发生.UIView1.2高度没有预期更新.

self.constraintChildViewHeight.constant = 95;
[self layoutIfNeeded];

NewView *newView = (NewView …
Run Code Online (Sandbox Code Playgroud)

objective-c uiscrollview ios uistackview

6
推荐指数
1
解决办法
564
查看次数

标签 统计

ios ×1

objective-c ×1

uiscrollview ×1

uistackview ×1