Skip to content

Instantly share code, notes, and snippets.

@pegli
Created November 2, 2012 16:21
Show Gist options
  • Save pegli/4002405 to your computer and use it in GitHub Desktop.
Save pegli/4002405 to your computer and use it in GitHub Desktop.
styled buttons in a toolbar
var toolbar = Ti.UI.iOS.createToolbar({
bottom: 0,
left: 0,
right: 0,
width: Ti.UI.FILL,
barColor: 'transparent',
translucent: true,
backgroundGradient: {
type: 'linear',
colors: [
{ color: '#B4DDF5', position: 0.0 },
{ color: '#60B3E8', position: 1.0 }
]
}
});
var button = Ti.UI.createButton({
title: 'New Test',
style: Ti.UI.iPhone.SystemButtonStyle.PLAIN,
borderWidth: 2,
borderColor: '#333',
borderRadius: 6,
enabled: true,
height: 36,
width: 120,
color: 'white',
backgroundColor: 'transparent',
backgroundGradient: {
type: 'linear',
colors: [
{ color: '#e77', position: 0.0 },
{ color: '#e00', position: 1.0 }
],
startPoint: 0.0,
endPoint: 1.0
}
});
var container = Ti.UI.createView({
width: Ti.UI.SIZE,
height: Ti.UI.SIZE
});
container.add(button);
toolbar.items = [container];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment