changing constraints at runtime in swift

后端 未结 2 1775
一个人的身影
一个人的身影 2021-01-25 06:53

I\'m really very weak in constraints part of ios. I have gone through many reference link as shown below but still not able solve my issue.

Hide autolayout UIView : How

2条回答
  •  無奈伤痛
    2021-01-25 07:22

    just make the outlet of height of both UIView and use constant property to change the height constraints like...

    if conditionfails{
         heightconstOfView1.constant = 0
    }
    else{
        heightconstOfView2.constant = 0
    }
    

提交回复
热议问题