Skip to content

Instantly share code, notes, and snippets.

@rakhimoni
Created December 14, 2017 11:50
Show Gist options
  • Save rakhimoni/06b374267f3fe88d72038b707c932108 to your computer and use it in GitHub Desktop.
Save rakhimoni/06b374267f3fe88d72038b707c932108 to your computer and use it in GitHub Desktop.
Windows: Commandbar Issue
function doClick(e) {
profile = Alloy.createController('profile');
}
var backButton = Ti.UI.Windows.createAppBarButton({
icon: Ti.UI.Windows.SystemIcon.BACK
});
likeButton = Ti.UI.Windows.createAppBarToggleButton({
icon: Ti.UI.Windows.SystemIcon.LIKEDISLIKE
});
forwardButton = Titanium.UI.Windows.createAppBarButton({
icon: Ti.UI.Windows.SystemIcon.FORWARD
});
commandBar = Ti.UI.Windows.createCommandBar({
items: [backButton, likeButton, forwardButton]
});
$.container.add(commandBar);
$.container.open();
<Alloy>
<Window id="container" backgroundColor="Pink">
<Label id="label" onClick="doClick">Click Me</Label>
</Window>
</Alloy>
// Arguments passed into this controller can be accessed via the `$.args` object directly or:
function doCheck(e) {
alert('Clicked');
}
var backButton = Ti.UI.Windows.createAppBarButton({
icon: Ti.UI.Windows.SystemIcon.BACK
});
likeButton = Ti.UI.Windows.createAppBarToggleButton({
icon: Ti.UI.Windows.SystemIcon.LIKEDISLIKE
});
forwardButton = Titanium.UI.Windows.createAppBarButton({
icon: Ti.UI.Windows.SystemIcon.FORWARD
});
commandBar = Ti.UI.Windows.createCommandBar({
items: [backButton, likeButton, forwardButton]
});
$.profile.add(commandBar);
$.profile.open();
<Alloy>
<Window id="profile">
<Label>This is the Child Window</Label>
<TextField id="textField" onKeypressed="doCheck" borderStyle="Ti.UI.INPUT_BORDERSTYLE_ROUNDED" color="#336699" top="10" left="10" width="250" height="60" />
<TextField id="textField2" borderStyle="Ti.UI.INPUT_BORDERSTYLE_ROUNDED" color="#336699" top="80" left="10" width="250" height="60" />
</Window>
</Alloy>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment