Adjusting UIView Height Inside UIStackView Control

前端 未结 4 1146
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:38

    1. First you need to add UIStackView on the cell

    2. Need to add constraints to your UIStackView

    3. Adjust your UIStackView

    4. Drag&Drop UILabel into your UIStackView

    5. Then Drag&Drop UIView into your UIStackView

    6. Add green-UIView like subview to pink UIView

    7. Now you can add couple constraints to green-UIView

    8. Now you can run app on simulator or device

      Notice that I don't added any constraints for UILabel.

提交回复
热议问题