var menu = e.menu;
var rightSymbolView = Ti.UI.createView({
width : Ti.UI.SIZE,
height : Ti.UI.SIZE
});
var rightSymbol = Alloy.createWidget("ti.ux.iconfont", "widget", {
right : 10,
size : 30,
color : "#fff",
icon : "fa-gear"
});
rightSymbol.setParent(rightSymbolView);
var menuItem = menu.add({
itemId : 0,
actionView: rightSymbolView,
showAsAction : Ti.Android.SHOW_AS_ACTION_ALWAYS
});
The above code doesn't work. The below one works as expected.
var menuItem = menu.add({
itemId : 0,
showAsAction : Ti.Android.SHOW_AS_ACTION_ALWAYS
});
menuItem.setActionView(rightSymbolView);
Can reproduce this problem which Titanium SDK 3.3.0 RC and 3.2.3. Here is a simpler test case I wrote:
Used getOrCreateView instead of peekView so that view will be created if it is not already created. https://github.com/appcelerator/titanium_mobile/pull/5900
Verified the fix. MenuItem's actionView property is working properly. Closing. Environment: Appc Studio : 3.4.0.201408051600 Ti SDK : 3.4.0.v20140815142514 Mac OSX : 10.8.5 Alloy : 1.4.1 CLI - 3.3.0 Code Processor: 1.1.1 Nexus 5 - android 4.4.4
testadded