title: ImageButton(ImageView) in custom layout for actionbarsherlock
body: <p>I'm using actionbarsherlock.</p>
  
  <p>In order to get action modes on bottom(<a href="https://dl.dropbox.com/u/20468014/as1.jpg" rel="nofollow noreferrer">action modes on bottom</a>) I use </p>
  
  <pre><code>android:uiOptions="splitActionBarWhenNarrow"
  </code></pre>
  
  <p>But I need to add a button to main action bar, so I use custom view.</p>
  
  <pre><code>    View customNav = LayoutInflater.from(this).inflate(R.layout.custom_view, null);      
      getSupportActionBar().setCustomView(customNav, new 
           ActionBar.LayoutParams(Gravity.RIGHT));
      getSupportActionBar().setDisplayShowCustomEnabled(true);
  </code></pre>
  
  <p>Here is custom_view.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="wrap_content"
      android:layout_height="fill_parent"
      android:gravity="center"
      android:orientation="horizontal"
  &gt;
  
  &lt;ImageButton
      android:id="@+id/btnMore"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:src="@drawable/ic_action_day"
      android:onClick="onMoreClick"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>It doesn't metter if I use ImageButton or ImageView with the same properties, so I'll talk about ImageButton.</p>
  
  <p>If I use the ImageButton, I get what I want except of that background is gray.
  <img src="https://i.stack.imgur.com/hvc0g.jpg" alt="enter image description here"></p>
  
  <p>If I add a line to previous custom_view.xml, in order to get transperent background(or use ImageView instead)</p>
  
  <pre><code>android:background="#00000000"
  </code></pre>
  
  <p>The alpha in icon will be "cropped" and size of button will change.
  <img src="https://i.stack.imgur.com/pK7PI.jpg" alt="enter image description here"></p>
  
  <p><strong>The question is. How to get button with such sizes as on first image(with default gray background) but with transperent background?</strong></p>
  
  <p>One of the ways to solve a problem is to make a color of the button's background the same as a color of actionbar and it will look like transperent, but I don't think it is a good solution.</p>