Skip to content

Instantly share code, notes, and snippets.

@aaronksaunders
Created October 2, 2011 21:33
Show Gist options
  • Select an option

  • Save aaronksaunders/1257993 to your computer and use it in GitHub Desktop.

Select an option

Save aaronksaunders/1257993 to your computer and use it in GitHub Desktop.
it works
var defaultColor = "#035385";
var window = Titanium.UI.createWindow({
backgroundColor:'#999'
});
var weatherData = [
{ title:"Mountain View (North America) - Cloudy", color:defaultColor},
{ title:"Washington, DC (North America) - Mostly Cloudy", color:defaultColor },
{ title:"Brasilia (South America) - Thunderstorm", color:defaultColor },
{ title:"Buenos Aires (South America) - Clear", color:defaultColor },
{ title:"Sucre (South America) - Mostly Cloudy", color:defaultColor },
{ title:"London (Europe) - Overcast", color:defaultColor },
{ title:"Moscow (Europe) - Partly Cloudy", color:defaultColor },
{ title:"Prague (Europe) - Clear", color:defaultColor },
{ title:"St Petersburg (Europe) - Snow", color:defaultColor },
];
var headerLabel = Ti.UI.createLabel({
backgroundColor:defaultColor,
color:"white",
font:{ fontSize: 16, fontWeight:"bold" },
text:"The Weather App",
textAlign:"center",
height:35,
width:320
});
var footerLabel = Ti.UI.createLabel({
backgroundColor:defaultColor,
color:"white",
font:{ fontSize:10 },
text:"[data supplied by Google Weather API]",
textAlign:"center",
height:25,
width:320
});
var searchBar = Titanium.UI.createSearchBar({
hintText: "test",
showCancel :true
});
var table = Ti.UI.createTableView({
backgroundColor:"white",
data: weatherData,
headerView:headerLabel,
footerView:footerLabel,
top:10,
width:320,
search : searchBar
});
window.add(table);
window.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment