Home

Awesome

Facebook's css-layout for Titanium

Exploring how it could be used to have a more iOS-autolayout-like layout system on Titanium.

Related JIRA ticket: TIMOB-18479

How I made it work for Titanim via JS

  1. Put Layout.js in Resources/Layout.js
  2. Add Resources/computeLayout.js to fix css-layout #24.
  3. Add Resources/Template.js to translate between ListView-like templates, css-layout and then to actual Titanium views.
  4. Play with it in Resources/app.js

How it might be useful for Titanium

Idealy this would replace the existing layout system. Whenever a view is added/changed/removed it would then use the C/Java version of css-layout to compute the top/left/width/height instead of Ti's own system. If Facebook makes css-layout stable it would give us a flexbox layout system much like iOS's autolayout, more flexible then our current one.

Other ideas: