Created
December 14, 2017 11:50
-
-
Save rakhimoni/06b374267f3fe88d72038b707c932108 to your computer and use it in GitHub Desktop.
Windows: Commandbar Issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Alloy> | |
<Window id="container" backgroundColor="Pink"> | |
<Label id="label" onClick="doClick">Click Me</Label> | |
</Window> | |
</Alloy> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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