ole / OLEContainerScrollView

A UIScrollView subclass that intelligently handles multiple child scroll views and does not interfere with UIKitʼs cell reuse functionality.
http://oleb.net/blog/2014/05/scrollviews-inside-scrollviews/
MIT License
587 stars 67 forks source link

How to implement UITableview datasource and delegate ? #6

Closed songwei89 closed 10 years ago

songwei89 commented 10 years ago

Thanks for the great component. Upon checking, I noticed that there aren't any code pieces for displaying any data on the cell (OLESimulatedTableView) How can I use this tableview as a subview of container. Thanks in advance.

ole commented 10 years ago

I am afraid I don't fully understand what you mean. Could you clarify? OLESimulatedTableView is only for demo purposes. It does not have the capability of displaying anything in the cells. You should use normal UITableViews or UICollectionViews instead.

songwei89 commented 10 years ago

Thanks for clarifying . This what I wanted to ask for . I have another quick question . Should I put content size , frame myself ? or ContainerSCrollView can adjust the layout(Frame, and ContentSize) automatically?

Thanks in advance

ole commented 10 years ago

You should not have to set the child views' frames, the container view will manage them. For a scroll view, contentSize has to be set, of course. Otherwise the container view would not know how big the scroll area is. But in the case of table and collection views, UIKit will take care of setting the contentSize and you should not interfere with this.

songwei89 commented 10 years ago

So here is my understanding that contentSize has to be set, and in order to set contentSize, I should know total frame size(Height) for container view?

On Aug 27, 2014, at 10:36 PM, Ole Begemann notifications@github.com wrote:

You should not have to set the child views' frames, the container view will manage them. For a scroll view, contentSize has to be set, of course. Otherwise the container view would not know how big the scroll area is. But in the case of table and collection views, UIKit will take care of setting the contentSize and you should not interfere with this.

— Reply to this email directly or view it on GitHub.