ricardoalcocer / actionbarextras

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

How can I set display HomeIcon in my app? #92

Closed myselfdeveloping closed 8 years ago

myselfdeveloping commented 8 years ago

I use the actionbarextras to set backgroundColor and colorTitle but I don't know how to show the icon in to the left of the window. Could you help me? Thanks! P.S. I'm sorry for my bad english.

manumaticx commented 8 years ago

Something like this:

function onOpen(){
  var activity = $.index.getActivity();

  if (activity) {

    var actionBar = activity.getActionBar();
    var abx = require('com.alcoapps.actionbarextras');

    if (actionBar) {
      actionBar.setHomeButtonEnabled(true);
      abx.setDisplayShowHomeEnabled(true);
      abx.setDisplayUseLogoEnabled(true);
      actionBar.setLogo('/images/logo.png');
      abx.setDisplayShowTitleEnabled(false);
    }
  }
}
manumaticx commented 8 years ago

Did this help?

myselfdeveloping commented 8 years ago

I tried now and it works! Amazing! Thanks for help!