title: Android Layout - set spacing between Image Buttons
body: <p>I have four buttons on top of a bar (background image) . What I'm trying to do is increase the spacing between the buttons (so they are spread out across the bar) and set the gravity to center_horozontal . I tries paddingLeft and paddingRight  on ImageButtons (okcancelbar_button_home) themselves but it doesn't seem to do anything. I'm thinking maybe the Image Buttons parent is the key but I don't know what to set there. Here is my layout :</p>
  
  <pre><code>                        ///////// main .xml //////////////////
  
                  &lt;merge
                      xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
  
                      &lt;com.onesix.test.OkCancelBar
                          android:layout_width="fill_parent" 
                          android:layout_height="60dip" 
                          android:layout_gravity="top"
  
                          android:paddingTop="0dip"
                          android:gravity="center_horizontal"
  
                          android:background="@drawable/header_bkgrnd"
                      /&gt;
  
                      &lt;!--"#AA000000"--&gt;
                  &lt;/merge&gt;
  
  
  
  
                  ////////// okCancelBar ////////////////
  
  
                  &lt;merge xmlns:android="http://schemas.android.com/apk/res/android"&gt;
                      &lt;include
                          layout="@layout/okcancelbar_button_home"
                          android:id="@+id/okcancelbar_home" 
                          android:layout_height="90dip" /&gt;
  
                      &lt;include
                          layout="@layout/okcancelbar_button_lists"
                          android:id="@+id/okcancelbar_lists" 
                          android:layout_height="90dip"
                          /&gt;
  
                        &lt;include
                          layout="@layout/okcancelbar_button_calendar"
                          android:id="@+id/okcancelbar_calendar" 
                          android:layout_height="90dip"
                          /&gt;
  
                       &lt;include
                          layout="@layout/okcancelbar_button_search"
                          android:id="@+id/okcancelbar_search" 
                          android:layout_height="90dip"
                          /&gt;
                  &lt;/merge&gt;
  
  
  
                  ////////////// okcancelbar_button_home ////////////////
                  &lt;?xml version="1.0" encoding="utf-8"?&gt;
                  &lt;ImageButton 
                      xmlns:android="http://schemas.android.com/apk/res/android"
                      android:id="@+id/but_home"
                      android:layout_width="75dip"
                      android:layout_height="60dip"
                      android:layout_alignParentBottom="true"
                      android:background="@android:color/transparent"
                      android:src="@drawable/button_menu_states_home"
                      android:paddingLeft="7dip"
                      android:paddingRight="7dip"
                      /&gt;
  
  
  
                  ////////////button_menu_states_home/////////
  
                  &lt;?xml version="1.0" encoding="utf-8"?&gt;
                   &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
                       &lt;item android:state_pressed="true"
                             android:drawable="@drawable/menu_button_home1_over" /&gt; &lt;!-- pressed --&gt;
                       &lt;item android:state_focused="true"
                             android:drawable="@drawable/menu_button_home1_over" /&gt; &lt;!-- focused --&gt;
                       &lt;item android:drawable="@drawable/menu_button_home1" /&gt; &lt;!-- default --&gt;
                   &lt;/selector&gt;
  </code></pre>