Question

What is so recommend way to do the following?

I have a surface with some html content which is layouted by the browser. Within the html a want to have an extra Scrollview with surfaces. Where to get the x,y, and width, height for the Scrollview from? Do i have to wait for the html to be rendered an THEN convert the inner-html part into a surface?

Was it helpful?

Solution

You can not use Surfaces as containers for other surfaces. You need to collect all your surfaces in a View, RenderNode, or ContainerSurface object.

https://github.com/Famous/core/blob/master/View.js https://github.com/Famous/core/blob/master/RenderNode.js https://github.com/Famous/surfaces/blob/master/ContainerSurface.js

Remember that the way that Famo.us lays out content is in the style of a render tree. With a tree analogy, the Surface would be a leaf, where the aforementioned Objects would act more like branches.

Here is everything you need to know about the Famo.us RenderTree:

https://github.com/Famous/guides/blob/master/dev/2014-04-09-render-tree.md

Also, take a look at the examples for each of the Objects mentioned as well. You can find the one that fits your use case best..

https://github.com/Famous/examples/blob/master/src/examples/core/View/example.js https://github.com/Famous/examples/blob/master/src/examples/surfaces/ContainerSurface/example.js

Hope this helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top