Created
February 18, 2015 14:19
-
-
Save jordiboehme/2763a51d768058f87e83 to your computer and use it in GitHub Desktop.
tabris.js layout example
This file contains hidden or 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
var page = tabris.create("Page", { | |
title: "Hello Layout!", | |
topLevel: true | |
}); | |
tabris.create("Button", { | |
id: "btn1", | |
text: "Button 1", | |
layoutData: {top: 10, left: 10, right: 10} | |
}).appendTo(page); | |
tabris.create("Button", { | |
id: "btn2", | |
text: "Button 2", | |
layoutData: {top: ["#btn1", 10], left: 10, right: 10} | |
}).appendTo(page); | |
tabris.create("TextView", { | |
text: "Lorem ipsum", | |
alignment: "center", | |
background: "gray", | |
layoutData: {top: ["#btn2", 10], bottom: ["#btn3", 10], left: 10, right: 10} | |
}).appendTo(page); | |
tabris.create("Button", { | |
id: "btn3", | |
text: "Button 3", | |
layoutData: {bottom: 10, left: 10, right: 10} | |
}).appendTo(page); | |
page.open(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment