How to make UIScrollView scrolling all content inside it

76 views Asked by At

I have UITextView, UIImageView, UILabel inside UIScroll View. I made that UITextView height equals its content and made scrollEnabled = false. UIScrollView scrolling not all content. I want that UIScrollView scrolling all content inside it. I want to make DetailViewController as in news applications. How do I make it?

1

There are 1 answers

0
Alexander Khitev On BEST ANSWER

I found a solve, I ctr-drag from UITextView Height constraint to DetailViewController and made following

@IBOutlet weak var textViewHeight: NSLayoutConstraint! {
    didSet {
        self.textViewHeight.constant = self.textView.sizeThatFits(CGSizeMake(self.textView.frame.size.width, CGFloat.max)).height
    }
}