0

I know there has a way to do it if I have a static value :

   UIView.animate(withDuration: 1) {
        self.heigth1.constant = 100
        self.grennView.layoutIfNeeded()
    }

but my UI is, there have a View ,and a label in the View. the View is Autolayout by the label's text. if I assignment a short String , the View will be short , If I assignment a long String ,the View will be long. So I don't have a static value of the height constant. I have tried:

     UIView.animate(withDuration: 0.25, animations: {
            self.invoiceInfoL.text = a long string
            self.invoiceView.updateConstraints()
            self.invoiceView.layoutIfNeeded()
        })

the frame had changed , but no animation. So it there any way to do the animation?

Neko
  • 581
  • 1
  • 9
  • 24

0 Answers0