Skip to content

Instantly share code, notes, and snippets.

@joacim-boive
Created June 4, 2010 19:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joacim-boive/425839 to your computer and use it in GitHub Desktop.
Save joacim-boive/425839 to your computer and use it in GitHub Desktop.
//Create a container view
var container = Ti.UI.createView({
width:200,
height:200,
top:10,
left:10
});
//Create a view for our content
var content = Ti.UI.createView({
width:195,
height:195,
top:0,
left:0,
borderRadius:5,
backgroundColor:"#000"
});
content.add(Ti.UI.createLabel({
text:"Here is some content",
textAlign:"center",
color:"#FFF",
font:{fontSize:18,fontWeight:'bold'}
}));
//Create a Shadow views.
var shadowBase = Ti.UI.createView({
width:content.width,
height:content.height,
top:content.top + 2,
left:content.left + 2,
borderRadius: content.borderRadius,
opacity:.5,
backgroundColor:"#787878"
});
container.add(shadowBase);
var shadow2 = Ti.UI.createView({
width:shadowBase.width,
height:shadowBase.height,
top:content.top + 3,
left:content.left + 3,
borderRadius:shadowBase.borderRadius,
opacity:.3,
backgroundColor:shadowBase.backgroundColor
});
container.add(shadow2);
var shadow3 = Ti.UI.createView({
width:shadowBase.width,
height:shadowBase.height,
top:content.top + 4,
left:content.left + 4,
borderRadius:shadowBase.borderRadius,
opacity:.1,
backgroundColor:shadowBase.backgroundColor
});
container.add(shadow3);
container.add(content);
//Open an application window
var win = Ti.UI.createWindow({
backgroundColor:"#fff"
});
win.add(container);
win.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment