1
votes

I have a UIScrollView that contains a UIToolbar, but when I scroll, the toolbar scrolls as well, separating from the bottom of the screen. Is there a way to make the toolbar stick to the bottom of the screen as the scroll happens?

I tried to create a view that contained both the ScrollView and the Toolbar, but when the program runs, the ScrollView is all that I can see. This problem could be due to the ScrollView being drawn on top of the toolbar, but I'm not sure.

Any help in either of these two methods (or even a third that I haven't thought of yet) would be greatly appreciated.

Thanks,
Chris

1
Putting the UIToolbar in the UIScrollView isn't the way to go - I'd be tempted to post the code you had with the objects in the same controller and get that working. (I presume you're creating the objects programmatically, rather than via interface builder.) - John Parker
I'm actually entirely using the interface builder, so there really isn't much code to worth with. When I saw the issue I sort of assumed the second approach was the way to go. Should I try to upload some screenshots of my interface builder? - Chris Covert

1 Answers

3
votes

If you're using the interface builder, you can simply re-size the UIScrollView so that it sits above where the UIToolbar will be placed. (Place the UIToolbar first and the UIScrollView will most likely snap to use the available space.)

If you're adding the UIToolbar programmatically, you can allow for its presence by selecting the "Toolbar" option under "Bottom Bar" within the Simulated Metrics section of the attributes inspector.