ricardoalcocer / actionbarextras

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

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

Closed myselfdeveloping closed 9 years ago

myselfdeveloping commented 9 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 9 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 9 years ago

Did this help?

myselfdeveloping commented 9 years ago

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