views:

54

answers:

1

Hi guys,

I got a small problem with my UIScrollView. I've added the scrollview to my UIView with Interface Builder. I've also added a UIToolbar as a subView (programmatically if it matters) to the view.

Now, my problem is that the scrollview scrolls under the UIToolbar. It doesn't "stop" at the top of the toolbar as it should to. It works if I change the size of the UIView, but that can't be the right thing to do, because then the toolbar becomes non-clickable.

I hope somebody can get me on the right track, thanks! :)

A: 

Try doing something along these lines after creating your toolbar:

CGRect scrollFrame = myScrollView.frame;
scrollFrame.size.height = scrollFrame.size.height - myToolbar.frame.size.height;
myScrollView.frame = scrollFrame;
BarrettJ
Thank you very much! That did it!
johannes