Closed trkfabi closed 8 years ago
Hi @trkfabi
sorry for the late reply.
Have you tried this with Titanium.Android.MenuItem.actionView
?
Something like this:
/**
* Android callback for {Ti.UI.Window} open event
*/
function onOpen() {
var activity = $.index.getActivity();
if (activity) {
var actionBar = activity.getActionBar();
activity.onCreateOptionsMenu = function(e) {
e.menu.clear();
e.activity = activity;
e.actionBar = actionBar;
var actionView = Ti.UI.createView({
backgroundColor: "white",
layout: 'vertical'
});
actionView.add(Ti.UI.createLabel({text: "foo", color: '#000'}));
actionView.add(Ti.UI.createLabel({text: "123", color: '#000'}));
var menuItem = e.menu.add({
title : "test",
actionView: actionView,
showAsAction : Ti.Android.SHOW_AS_ACTION_ALWAYS
});
menuItem.expandActionView();
};
activity.invalidateOptionsMenu();
};
}
Is it possible to add a custom view (Ti.UI.view) to the actionbar? I want to show menuItem icons on the right and show a view on the left containing 2 labels that will be dynamically updated from time to time (i.e.: an account balance that gets updated with every $ movement).
Thanks