I have a scroll view that has a hidden UIPicker at the bottom which is hidden in viewDidLoad()
. This UIPicker is unhidden when a user hits a button. I want my UIScrollview to adjust its height automatically based on whether or not the UIPicker is visible.
However, my scrollview is still trying to take into account the height of the UIPicker and so it goes down further than I would like. I am trying to remedy this by changing the contentSize of the scrollview.
pickerHeight = graphTypePicker.frame.size.height
graphTypePicker.hidden = true
scrollView.contentSize = CGSizeMake(scrollView.contentSize.width, scrollView.contentSize.height - pickerHeight
However, this is not working. Any suggestions? I've tried messing with the frame height before, but that didn't seem to work either.