Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My UIScrollView bounces back to the top when i let it go

I have two problems with my UIScrollView, first, when i launch the app, the first screen i see is the one which contain the UIScrollView, so i try to scroll but i couldn't, it like if it is locked, so i navigate to other screens in the app, and when i go back to the first screen it scrolls very well. the second problem is that when i scroll down and since i let the UIScrollView go, it bounces back to the top and so i can't interact with the content I just scrolled to.

enter image description here

like image 258
Malloc Avatar asked Oct 09 '22 23:10

Malloc


1 Answers

check the @property contentSize. I bet it is set to CGSizeZero.

The height must be set to the maximum Y of the last element (in terms of Y-position) of your scrollView subviews.

You might want to have a look at this page, it has a lot of information regarding the UIS

like image 184
Pier-Olivier Thibault Avatar answered Oct 14 '22 02:10

Pier-Olivier Thibault