Comments (6)
Hi, you have to specify the size for layoutController1
:
var layoutController1 = new LayoutController({
size: [undefined, 90],
...
});
The size is never automatically derived from the children.
You can also add a custom getSize
function to the LayoutController in which you yourself calculate the desired height:
var layoutController1 = new LayoutController({...});
layoutController.getSize = function() {
// calculate height...
return [undefined, 90];
};
from famous-flex.
thanks for the quick reply! I already feared that that would be the case. The sublists for each item contain a varying number of surfaces with their height set to true, so I have to add up all their sizes (plus the space between elements if there is any), right?
I think it would be cool to allow auto sizing for the LayoutController as an option so that its size is derived from its children.
from famous-flex.
I like the idea of letting the LayoutController use the size of the child renderables. I'll see whether I can come up with an elegant solution for it.
from famous-flex.
Hi, I've implemented this feature. I've added the ability to specify size: [undefined, true]
to a LayoutController. It will then calculate the height of all the child renderables, which is then returned by the layoutController.getSize
function.
Example:
var layoutController = new LayoutController({
layout: ListLayout,
size: [undefined, true], // tell the LayoutController to derive the height from the child-renderables
dataSource: [
new Surface({
size: [undefined, true],
content: 'sample text'
}),
new Surface({
size: [undefined, true],
content: 'sample text<br><br>testing'
})
]
});
I've created a demo project for it here:
https://github.com/IjzerenHein/famous-flex-truesize-layoutcontroller-demo
Let me know whether this solves your problem.
Cheers!
from famous-flex.
This solved my problem. Thank you for your great work and a happy new year!
from famous-flex.
Awesome, great to hear!
Happy new year to you too.
from famous-flex.
Related Issues (20)
- velocity limit HOT 10
- Scrollview is only partially shown (after blurring an input element, window scroll position isnt reset) HOT 9
- Pull to refresh on desktop HOT 3
- any plans to support https://github.com/Famous/engine/tree/v1.0.0? HOT 7
- Scrollview: scroll without animation HOT 3
- Invalid bower version HOT 2
- FlexScrollView - mousepad two finger scrolling doesn't work in paginated view
- LayoutController insert 0 not working HOT 6
- CollectionLayout last row just partial visible HOT 1
- WheelLayout (DatePicker) sometimes wrong number sequence HOT 7
- Possible Bug in CollectionLayout HOT 5
- Is mixed-mode really good(right) ? HOT 7
- What is the state of Famous-Flex? HOT 6
- Surface leakage issue because of Entity.register HOT 2
- Bug in DatePicker.Component.FullDay HOT 7
- SamsaraJS support
- Error: HOT 6
- Correction in documentation HOT 2
- Use famous-sizeconstraint with FlexScrollView
- Changes to LinkedListViewSequence does not get reflected in FlexScrollView
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from famous-flex.