Last active
November 12, 2015 09:22
-
-
Save falkolab/efa28be3c7f56e6d1f1f to your computer and use it in GitHub Desktop.
Using https://github.com/falkolab/Ti.SvgView with `ListView` in Titanium SDK. Demo app https://github.com/falkolab/ListView-SVG-Demo-Alloy-App
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('uiModules') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Alloy> | |
<ListView title="Demo: SVG + ListView" defaultItemTemplate="customTemplate"> | |
<Templates> | |
<ItemTemplate name="customTemplate"> | |
<SvgView platform="android" bindId="svgImage" ns="Alloy.Globals.uiModules" /> | |
<View platform="ios" bindId="svgImage" ns="Com.Geraudbourdin.Svgview"/> | |
</ItemTemplate> | |
</Templates> | |
<ListSection> | |
<ListItem svgImage:image="/images/foo1.svg"/> | |
<ListItem svgImage:image="/images/foo2.svg"/> | |
<ListItem svgImage:image="/images/foo3.svg"/> | |
</ListSection> | |
</ListView> | |
</Alloy> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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