Adjusting UIView Height Inside UIStackView Control

前端 未结 4 1163
Happy的楠姐
Happy的楠姐 2020-12-06 09:59

I am using a UIStackView in iOS 9 SDK. The height of the stackview is 44 points. I have a UILabel and UIView inside the StackView as shown below:

Now, I wa

4条回答
  •  误落风尘
    2020-12-06 10:23

    I wanted to post my answer here so others could see, despite a slightly different problem from OP's.

    I was trying to resize a UIView that contained a UIStackView and the constraints were breaking. I was changing the UIView's height constraint between 0 and 66 depending on if there was relevant info to show that the stack view was displaying for.

    I was able to fix the breaking constraints by removing top and bottom constraints of the stack view inside the view, and instead set it to be vertically centered. This resulted in much smoother scrolling in my table view.

提交回复
热议问题