StackView isHidden attribute not updating as expected

前端 未结 3 1408
生来不讨喜
生来不讨喜 2021-02-05 08:37

I\'m trying to update a UIStackView so that a field displays, should the value of a UITextField equal \"Other\". Here is my code:

3条回答
  •  走了就别回头了
    2021-02-05 09:04

    try to manipulate alpha along with isHidden property:

    self.stackView.arrangedSubviews[3].isHidden = true
    self.stackView.arrangedSubviews[3].alpha = 0
    
    self.stackView.arrangedSubviews[3].isHidden = false
    self.stackView.arrangedSubviews[3].alpha = 1
    

提交回复
热议问题