This is very similar to the answer I just posted here.
how best to create a single scrollable view in famo.us?
You can wrap your true-sized surfaces in a sized modifier. This allows for scrollview to know the actual height of the surfaces within, and thus properly scroll. I am using the _currTarget of surface in the Modifiers sizeFrom method. The ternary operation is to prevent errors pre-deploy of the surface.
Here is that example revised for multiple cells in scrollview.. Hope it helps!
var Engine = require('famous/core/Engine');
var Surface = require('famous/core/Surface');
var RenderNode = require('famous/core/RenderNode');
var Modifier = require('famous/core/Modifier');
var Scrollview = require('famous/views/Scrollview');
var context = Engine.createContext();
var content = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod \
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, \
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo \
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse \
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non \
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
var scrollview = new Scrollview();
var surfaces = [];
scrollview.sequenceFrom(surfaces);
for (var i = 0; i < 10; i++) {
var surface = new Surface({
size:[undefined,true],
content: content,
properties:{
fontSize:'24px',
backgroundColor:'hsl('+(i*360/20)+',100%,50%)'
}
})
surface.pipe(scrollview);
surface.node = new RenderNode();
surface.mod = new Modifier();
surface.mod.sizeFrom(function(){
target = this._currTarget;
return target ? [undefined,target.offsetHeight] : [undefined,true];
}.bind(surface));
surface.node.add(surface.mod).add(surface);
surfaces.push(surface.node);
};
context.add(scrollview);