Created
September 21, 2012 13:38
-
-
Save lcruz/3761496 to your computer and use it in GitHub Desktop.
Agregar una ventana de titulo en android
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 addTitleToWin(win, title) { | |
// Si es la pantalla del home no se agrega titulo | |
//Ti.API.info("title WIN : " + title); | |
if (typeof title == 'undefined') { | |
return; | |
} | |
var titleLabel = Ti.UI.createLabel({ | |
text: title, | |
color: 'white', | |
font:{fontSize:20,fontWeight:'bold'}, | |
shadowOffset: {x:0,y:1}, | |
shadowColor : 'black', | |
textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER, | |
height: 38, | |
width: 320 | |
}); | |
var viewTitle = Ti.UI.createView({ | |
layout: 'horizontal', | |
height: 40, | |
color: 'white', | |
backgroundGradient: { | |
type: 'linear', | |
startPoint: {"y": 0.0, "x": 0.0}, | |
endPoint: {"y": 20.0, "x": 0.0}, | |
colors: [ { color: '#52514B', offset: 0.0}, { color: '#34332F', offset: 1 } ], | |
} | |
}); | |
viewTitle.add(titleLabel); | |
win.add(viewTitle); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment