Created
September 21, 2012 18:53
-
-
Save Mindelusions/3763208 to your computer and use it in GitHub Desktop.
Titanium - Simple Slide Down Info Window
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
var win = Ti.UI.createWindow({ | |
backgroundColor:'#dfdfdf', | |
title:'Main Win', | |
navBarHidden:false | |
}); | |
var lbl = Ti.UI.createLabel({ | |
text:'Background Window' | |
}); | |
win.add(lbl); | |
var InfoWin = require('InfoWin'), | |
infowin = new InfoWin(); | |
win.addEventListener('open', function() { | |
infowin.open(); | |
}); | |
win.open(); |
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
function InfoWin(_args) { | |
var self = Ti.UI.createWindow({ | |
backgroundColor:'#000', | |
height:480, | |
bottom:436 | |
}); | |
var infolbl = Ti.UI.createLabel({ | |
text:'Info', | |
color:'#fff', | |
bottom:0 | |
}); | |
var isShowing = false; | |
infolbl.addEventListener('click', function() { | |
if (isShowing) { | |
self.animate({ | |
bottom:436 | |
}); | |
isShowing = false; | |
} else { | |
self.animate({ | |
bottom:80 | |
}); | |
isShowing = true; | |
} | |
}); | |
var infotxt = Ti.UI.createLabel({ | |
text:'This is more information about the background window. Click "Info" again to hide.', | |
color:'#fff' | |
}); | |
self.add(infotxt); | |
self.add(infolbl); | |
return self; | |
}; | |
module.exports = InfoWin; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment