Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot pull to refresh if contentSize is smaller than frame #141

Open
disorderdev opened this issue Jul 15, 2013 · 6 comments
Open

cannot pull to refresh if contentSize is smaller than frame #141

disorderdev opened this issue Jul 15, 2013 · 6 comments

Comments

@disorderdev
Copy link

I tried to set alwaysBounceVertical=YES, but I found that if infiniteScrolling is added at the same time, then both of them will show and animate

@wsnnn
Copy link

wsnnn commented Jul 17, 2013

If the height of the content is less than the height of the screen(or tableView), set contentSize for tableView equal height of the screen.

@hsoi
Copy link

hsoi commented Sep 9, 2013

FWIW, I ran into this same (or at least a similar) problem. I had a UIScrollView whose contents I constructed on my own (not a UITableView). contentSize was smaller, thus I couldn't pull. @wsnnn's suggestion got me on the right track, but I couldn't make the contentSize equal to the height of my enclosing view -- I had to make it the height + 1. That made things work.

@chrise86
Copy link

@hsoi can you give an example of what you did please? I have the same problem and tried the following, to no avail:

[collectionView setContentSize:CGSizeMake(view.frame.size.width, view.frame.size.height + 1)]

@hsoi
Copy link

hsoi commented Dec 28, 2014

I did exactly what I wrote in my comment, which is essentially the same thing you're doing except I was working on a pure UIScrollView, not a UICollectionView (nor UITableView) which may be having an interaction effect with other layout calculations. Sorry.

@chrise86
Copy link

I ended up subclassing UICollectionViewFlowLayout and overriding the collectionViewContentSize method

@FutureAndroidDeveloper
Copy link

var alwaysBounceVertical: Bool { get set }

If this property is set to true and bounces is true, vertical dragging is allowed even if the content is smaller than the bounds of the scroll view. The default value is false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants