ricardoalcocer / actionbarextras

Titanium Android Native Module that exposes ActionBar features not exposed by the Titanium SDK
MIT License
149 stars 60 forks source link

setMenuItemIcon not working with TabGroup #123

Open TimDorand opened 6 years ago

TimDorand commented 6 years ago

I can't set Icons on the Action Bar when put the TabGroup window. I works great when I remove this

<TabGroup>
    <Tab></Tab>
</TabGroup>

Here is my controller


$.files.addEventListener('open', function (e) {
  abx.backgroundColor = "#000"
  var activity = $.files.getActivity();
  if (activity) {
    console.log('settings menu initiate')
    activity.onCreateOptionsMenu = function (e) {
      var settingsItem = e.menu.add({
        itemId: 102, // don't forget to set an id here
        title: "Settings",
        showAsAction: Ti.Android.SHOW_AS_ACTION_ALWAYS
      });
      settingsItem.addEventListener('click', function () {
        alert('Open settings to manage cloud accounts');
      });
      abx.setMenuItemIcon({
        menu: e.menu,
        menuItem: settingsItem,
        fontFamily: fa.fontfamily,
        icon: fa.icon("fa-ellipsis-v"),
        color: "white",
        size: 30
      });
    }
  }
})