I have an UIScrollView and horizontally scrollable content. I can properly set up the content size, etc, but I need to place another similar ScrollView just below the first one. So, I need to make height of the ScrollView to be equal to height of its content. Currently I use this code, but it does not work. I attached screenshot with issue and the code:
//setting the correct content size of scrollView (self.contentSize is already calculated)
self.imageScrollView.contentSize = self.contentSize;
//creating temporary CGRect
CGRect frame = self.imageScrollView.frame;
//Changing the height and re-assigning new frame to imageScrollView
frame.size.height = self.contentSize.height;
self.imageScrollView.frame = frame;
Look at the screenshot: the imageScrollView is just below NavBar. The content still scrollable and the size of ScrollView is smaller than content size.