Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

portem1

macrumors newbie
Original poster
Jan 18, 2011
9
0
Hello,

I have an UIScrollView that I fill dynamically with UILabels.
At the end I need to allow scrolling if the contents are larger than the containing view.
I try to do this with:
scrollhowtouse.frame=CGRectMake(0,0,320, yf);
where yf is the end position calculated by my program.
But doing so just displays the full screen and scrolling is not possible.

What point do I miss here?

Thanks for your answers
 
A lot of factors left out to fully know why the problem is. Is yf defined before that line is executed? Is 0, 0, and 320 already initialized?
 
The UIScrollView should be sized to the screen/space you want it in (this is the frame). The UIScrollViews contentSize property should be set to the size of the content view. If the contentSize is larger than the frame (and scrolling is enabled) then you can scroll the content.
 
The UIScrollView should be sized to the screen/space you want it in (this is the frame). The UIScrollViews contentSize property should be set to the size of the content view. If the contentSize is larger than the frame (and scrolling is enabled) then you can scroll the content.

Thanks, i did like you said and it works!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.