Моя точка зрения следующая.
I am expanding the text view programmatically depending on the text as follows
func textViewDidChange(_ textView: UITextView) {
let size = CGSize(width: titleAndDescriptionContainerView.frame.width, height: .infinity)
let estimatedSize = noteDescription.sizeThatFits(size)
noteDescription.constraints.forEach{
(constraint) in if constraint.firstAttribute == .height{
constraint.constant = estimatedSize.height
}
}
titleAndDescriptionContainerView.constraints.forEach{
(constraint) in if constraint.firstAttribute == .height{
constraint.constant = estimatedSize.height + noteTitle.frame.height
}
}
entireScrollView.contentSize = CGSize(width: entireScrollView.frame.width, height: (imageScrollView.frame.height + titleAndDescriptionContainerView.frame.height + audioContainerView.frame.height))
}
I am also changing the size of the entire scroll view. But I am not able to scroll my view when the text is long. have a look at these screenshots.
введите описание изображения здесь