Android custom action bar remove icon -


below screenshot of current setup.

enter image description here

i have created custom action bar view, set in code below, , 2 images, 1 left aligned in title bar, other right aligned.

the problem is, when hide app icon, hides it, not removes hence gap on left. found couple of other questions show how remove icon, removes tabs want keep.

can 1 offer me solution?

from oncreate() function:

final actionbar actionbar = getactionbar();         actionbar.setnavigationmode(actionbar.navigation_mode_tabs);              layoutinflater inflater = (layoutinflater) this.getsystemservice(context.layout_inflater_service);         view v = inflater.inflate(r.layout.action_bar_title, null);          view homeicon = findviewbyid(android.r.id.home);         ((view) homeicon.getparent()).setvisibility(view.gone);         ((view) homeicon).setvisibility(view.gone);                  actionbar.setdisplayshowcustomenabled(true);         actionbar.setdisplayshowtitleenabled(false);           actionbar.setdisplayshowhomeenabled(true);         actionbar.setcustomview(v); 

my xml custom layout:

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"         android:layout_height="fill_parent"     android:gravity="fill_horizontal"     android:layout_marginleft="0dp"     android:orientation="horizontal"     >          <imageview android:id="@+id/title_img_left"                     android:layout_width="wrap_content"                     android:layout_height="wrap_content"                     android:layout_alignparentleft="true"                     android:layout_alignparenttop="true"                                         android:src="@drawable/test" />      <imageview android:id="@+id/title_img_right"                     android:layout_width="wrap_content"                     android:layout_height="wrap_content"                     android:layout_alignparentright="true"                     android:layout_alignparenttop="true"                     android:src="@drawable/test" />   </relativelayout> 

i'm using holo.light.darkactionbar theme believe.

so if understand thing trying achieve, why don't add menuitem custom image on left side , set actionbarlogo image want on right side. after override home button click , guess achieve same thing can create custom view, without padding on left side of actionbar.

p.s. if understand wrong, please give more information on how should like.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -