I have a ScrollView, and a container view inside of it.
UIButtons are inside of the container view.
When I run the program, UIButtons
that are at the end of the ScrollView are unresponsive.
UITextFields are responsive.
Yet, after tweaking around with frames I made sure that both origin and hightXwidth of UIScrollView and container view are matched. I checked it with print statements.
Some of the settings:
scrollView.isExclusiveTouch = true
scrollView.delaysContentTouches = false
scrollView.isUserInteractionEnabled = true
ScrollView's content size:
let hightForScrollMenu: CGFloat = 120
scrollView.contentSize = CGSize(width: scrollView.frame.size.width, height: scrollView.frame.size.height+hightForScrollMenu)
When checking:
viewInsideScrollView.frame.size.height = scrollView.frame.size.height
print("Zhenya: ScrollView's frame height is:\(scrollView.frame.size.height) and its origin is \(scrollView.frame.origin)")
print("Zhenya: ViewInsideScrollView's frame heigt is: \(viewInsideScrollView.frame.size.height) and its origin is \(scrollView.frame.origin)")
View Controller attributes:
Main View attributes and constraints:
ScrollView attributes and constraints:
Container View attributes and constraints: