[ALOY-439] ActionItems created in markup don't appear in action bar.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Resolved |
Resolution | Cannot Reproduce |
Resolution Date | 2014-02-07T15:58:40.000+0000 |
Affected Version/s | Alloy 0.3.3 |
Fix Version/s | 2014 Sprint 03 |
Components | XML |
Labels | n/a |
Reporter | Arthur Evans |
Assignee | Tim Poulsen |
Created | 2012-12-20T03:10:55.000+0000 |
Updated | 2014-02-11T16:09:28.000+0000 |
Description
I'm trying to create action items using code like this:
index.xml:
<Alloy>
<Window class="container" onOpen="doWindowOpen" navBarHidden="false" exitOnClose="true">
<Menu id="menu" platform="android">
<MenuItem id="item1" title="One" onClick="doMenuClick" />
<MenuItem id="item2" title="Two" onClick="doMenuClick" />
</Menu>
<Label id="label" onClick="doClick">Hello, World</Label>
</Window>
</Alloy>
index.tss:
".container": {
},
"MenuItem": {
showAsAction: Ti.Android.SHOW_AS_ACTION_ALWAYS
},
"#item1": {
title: "One"
},
"#item2": {
title: "Two",
icon: "images/action_refresh.png"
},
"Label": {
width: Ti.UI.SIZE,
height: Ti.UI.SIZE,
color: "#000"
}
However, even though the menu items seem to be being created with showAsAction set to Ti.Android.SHOW_AS_ACTION_ALWAYS, they don't show up in the UI.
If I add menu items in the open callback by specifying an onCreateOptionsMenu method and then calling invalidateOptionsMenu, the action items appear correctly.
Conclusion: something is jacked with the menu items created from markup.
(Deep, huh?)
Attachments
File | Date | Size |
---|---|---|
app.zip | 2014-02-07T15:56:41.000+0000 | 3262411 |
Screen Shot 2014-02-07 at 10.56.46 AM.png | 2014-02-07T15:57:39.000+0000 | 26617 |
attached file
screenshot
I cannot reproduce with Alloy 1.3.0, SDK 3.2.0.GA. Tested with the attached app. See the screenshot attached for my results. Items appear in ActionBar as expected, event handlers fire when clicked.