Skip to content

Instantly share code, notes, and snippets.

@dested
Created May 10, 2016 19:28
Show Gist options
  • Save dested/f69d1ca70a13f05e27d3d8cefb5997a5 to your computer and use it in GitHub Desktop.
Save dested/f69d1ca70a13f05e27d3d8cefb5997a5 to your computer and use it in GitHub Desktop.
var page = new tabris.Page({
title: "TabFolder - Swipe",
topLevel: true
});
var sv = new tabris.ScrollView({
left: 0,
top: 50,
height: 400,
background: "#AB47BC"
}).appendTo(page);
new tabris.CollectionView({
items: [{ text: 'a' }, { text: 'b' }, { text: 'c' }, { text: 'd' }],
itemHeight: 256,
initializeCell: function (cell) {
var nameTextView = new tabris.TextView({
layoutData: { left: 30, top: 16, right: 30 },
alignment: "center"
}).appendTo(cell);
cell.on("change:item", function (widget, t) {
nameTextView.set("text", t.text);
});
}
}).on("select", function (target, value) {
console.log("selected", value.text);
}).appendTo(sv);
page.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment