title: How to remove the background of Layout completely
body: <p>In my main Activity i have created a<code>FrameLayout</code>. I have added a <code>Button</code> and a <code>Background Image</code> it it.  </p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="56dp"
       android:id="@+id/header_layout"
      android:background="@drawable/top_header"
      &gt;
  
  &lt;Button
    android:layout_width="25dp"
    android:layout_height="25dp"
    android:layout_marginLeft="10dp"
    android:id="@+id/btn_openDrawer"
    android:background="@drawable/more"
    android:layout_gravity="center|left"
    /&gt;
   &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>In multiple fragments i am using this header.</p>
  
  <p>But in one of the Fragment, I only need button without background image.</p>
  
  <p>I have tried almost everything from <code>opacity</code> to <code>alpha(0)</code> but in every case it does not take away the space taken by <code>Frame Layout</code>. It starts displaying <code>white transparent</code> color when i remove or bring opacity down of image.</p>
  
  <p>I want it to take only the space taken by this button  <a href="https://i.stack.imgur.com/UnvJU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UnvJU.png" alt="enter image description here"></a> . and put the contents of fragments above it.</p>
  
  <p>Right now it takes <code>56dp</code> height, which i defined for <code>Frame Layout</code> and starts displaying the contents of <code>Fragment Layout</code> after header height, which is <code>56dp</code>.</p>
  
  <p>If i change the height of <code>Frame Layout</code> to <code>0dp</code>, it stops displaying the button on as well. </p>
  
  <p><strong>Home Activity</strong></p>
  
  <p></p>
  
  <pre><code>&lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      android:id="@+id/home_layout"
      &gt;
  
      &lt;include layout="@layout/header_layout"/&gt;
      &lt;include layout="@layout/content_home" /&gt;
  
  &lt;/LinearLayout&gt;
  //NavigationView...
  </code></pre>
  
  <p><strong>HomeActivity.Java</strong></p>
  
  <pre><code>        switch (item.getItemId()){
  
              case R.id.nav_home:
                  fragmentTransaction= getSupportFragmentManager().beginTransaction();
                  fragmentTransaction.replace(R.id.main_container,new MainActivity());
                  fragmentTransaction.commit();
                  item.setChecked(true);
                  drawerLayout.closeDrawers();
                  break;
  
  //This Code is displaying Header With Image
  
              case R.id.nav_more:
                  fragmentTransaction= getSupportFragmentManager().beginTransaction();
                  fragmentTransaction.replace(R.id.main_container, new MoreActivity());
                  fragmentTransaction.commit();
                  item.setChecked(true);
                  drawerLayout.closeDrawers();
                  break;
          }
  </code></pre>
  
  <p>Kindly guide me, I am just stuck into this for more than 8 hours now. </p>
  
  <p>Thanks</p>