Last active
January 6, 2018 03:55
-
-
Save arturoleon/3724659 to your computer and use it in GitHub Desktop.
Loading window for Titanium Mobile
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
//Usage example | |
var win = Ti.UI.createWindow(); | |
var loadingWindow = require('LoadingWindow')(); | |
win.add(loadingWindow); | |
//win.remove(loadingWindow) | |
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 loadingWindow(msg){ | |
if(msg === undefined) var msg = 'Cargando'; | |
//loading window for iOS (not tested in Android) | |
var self = Titanium.UI.createView({ | |
height:90, | |
width:120, | |
backgroundColor:'#000', | |
borderRadius:10, | |
opacity:0.8, | |
touchEnabled:false | |
}); | |
var actInd = Titanium.UI.createActivityIndicator({ | |
top:8, | |
height:50, | |
width:50, | |
style:Titanium.UI.iPhone.ActivityIndicatorStyle.BIG | |
}); | |
var message = Titanium.UI.createLabel({ | |
text:msg, | |
color:'#fff', | |
textAlign:'center', | |
font:{fontSize:18,fontWeight:'bold'}, | |
height:'auto', | |
width:'auto', | |
top:'55' | |
}); | |
actInd.show(); | |
self.add(actInd); | |
self.add(message); | |
return self; | |
} | |
module.exports = loadingWindow; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment