Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Titanium.UI.setBackgroundColor('#000');
- // create tab group
- var tabGroup = Titanium.UI.createTabGroup();
- var win = Titanium.UI.createWindow({
- title:'Tab 1',
- backgroundColor:'#fff'
- });
- var tab1 = Titanium.UI.createTab({
- icon:'KS_nav_views.png',
- title:'Tab 1',
- window:win
- });
- var view = Titanium.UI.createImageView({
- height:43,
- width:98,
- top:10,
- image:'closewin.png', //image file
- transform:Ti.UI.create3DMatrix().rotate(180, 0, 1, 0)
- });
- win.add(view);
- var save = Titanium.UI.createButton({
- title:'Save',
- width:120,
- height:40,
- bottom:20,
- right:0,
- });
- save.addEventListener('click', function()
- {
- // file system
- var photoname= new Date().getTime()+".png";
- var f = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,photoname);
- f.write(view.toImage());
- });
- win.add(save);
- tabGroup.addTab(tab1);
- tabGroup.open();
Add Comment
Please, Sign In to add comment