i have a problem with my UIScrollView, i have created it in interface builder and then i have connected it to my view, but i have a bizarre problem, when i click to open the view with the scroll view, some time appear at the top, some time appear scrolled at the bottom, and some time in the middle for example, i want that appear always at the top, how i can do?…if i click on the status bar the uiscrollview scroll up how it should be, and i have also tried to add this:
[self.myScrollView scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:NO];
in my configure view in view will appear, but don’t work appear scrolled random in every position…there is a solution?
You can use scrollRectToVisible to always have it appear in the same spot. Let’s say you have a UIScrollView where the frame size is (100,100). And you have a content size of (100,200). If you wanted that to appear at the top, you would call:
if you wanted to center the content you would do this:
if this is not working for you, then your scrollview is not setup properly and you’d need to provide more details on how you set it up.