title: Android Custom LinearLayout and inflating xml
body: <p>I have an <code>xml</code> layout that when inflated into a <code>View</code> object, the layout displays as expected. However, I created a custom <code>LinearLayout</code> class, and inflate the <code>xml</code> layout when creating an instance of the class by using </p>
  
  <pre><code>LayoutInflater.from(context).inflate(R.layout.icon_item, this, true);
  </code></pre>
  
  <p>in the constructor. I am not setting any <code>LayoutParams</code> or anything on the custom <code>LinearLayout</code> class, and when I try to display the custom class, it seems there are some weird margins placed that cut off some of the text in the layout inside.</p>
  
  <p>I want to know if there is any way to set the custom <code>LinearLayout</code> so it has no effects on the layout xml, but just acts as an invisible container. I thought setting "attachToRoot" to true when inflating would solve this, but didn't work as expected.</p>