Set height UILabel to 0

后端 未结 3 1600
悲哀的现实
悲哀的现实 2021-01-27 13:09

Is there anyway to set the height of a UILabel programmatically? I\'ve added a bunch of constraints to my .Xib files so every other label is dependent upon the one above or belo

相关标签:
3条回答
  • 2021-01-27 13:57

    plz take the IBoutlet of constraint height and set the height you want

    0 讨论(0)
  • 2021-01-27 14:06

    try this:

    var frame: CGRect = nameLabel.frame
    frame.size.height = height
    nameLabel.frame = frame
    
    0 讨论(0)
  • 2021-01-27 14:12

    Write this line :

    constLblHeight.constant = 0;
    
    //Below image step
    //Step 1: Add Constraint in label height
    //Step 2: Create object of label height constraint (constLblHeight)
    

    0 讨论(0)
提交回复
热议问题