Skip to content

Instantly share code, notes, and snippets.

Last active Nov 12, 2015
What would you like to do?
<ListView title="Demo: SVG + ListView" defaultItemTemplate="customTemplate">
<ItemTemplate name="customTemplate">
<SvgView platform="android" bindId="svgImage" ns="Alloy.Globals.uiModules" />
<View platform="ios" bindId="svgImage" ns="Com.Geraudbourdin.Svgview"/>
<ListItem svgImage:image="/images/foo1.svg"/>
<ListItem svgImage:image="/images/foo2.svg"/>
<ListItem svgImage:image="/images/foo3.svg"/>
// app/lib/uiModules.js
var o = {
createSvgView: function(opts) {
var m = require("com.geraudbourdin.svgview");
return m.createView(opts);
// place other modules here to use with ns or module attributes in alloy
//_.extend(o, require(""));
module.exports = o;
Alloy.Globals.uiModules = o;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment