Demonstrate CollapsableView Tag in Alloy.
// put in the lib folder
exports.createCollapsableView = function(args) {
var view = Ti.UI.createView(args);
view.collapse = function() {
view.expandedHeight = view.expandedHeight || view.height;
view.height = 0;
};
view.expand = function() {
view.height = view.expandedHeight;
};
return view;
};
<Alloy>
<CollapsableView module="ui" id="myView" height="200" width="Ti.UI.FILL" layout="vertical">
<Label top="20">Hello there</Label>
<Button top="20" onClick="collapse">Collapse Me</Button>
</CollapsableView>
</Alloy>
function collapse(){
$.myView.collapse();
// $.myView.expand();
}