title: What's the difference between android:height and android:layout_height?
body: <pre><code>&lt;TextView
      android:layout_width="match_parent"
      android:layout_height="48dp"
      android:paddingTop="48dp"
      android:text="Test"
      /&gt;
  </code></pre>
  
  <p>I would expect the TextView to have a measured height of 96dp, regardless of how much space (height-wise) "Test" took up (would expect it to cut off).</p>
  
  <p>Instead, I get the full "Test" + 48dp for the padding.</p>
  
  <p>I can put any valid value for <code>layout_height</code> and get the same result.</p>
  
  <p>To get my 96dp height, I need:</p>
  
  <pre><code>&lt;TextView
      android:layout_width="match_parent"
      android:layout_height="&lt;any valid value&gt;"
      android:height="48dp"
      android:paddingTop="48dp"
      android:text="Test"
      /&gt;
  </code></pre>
  
  <p>where again, I can put <code>layout_height</code> as any valid value (but it needs to be there as a required attribute).</p>
  
  <p>I've never used the <code>height</code> attribute in XML but I couldn't find the difference in the docs, particularly how each one is calculated when the element it's operating on also has values set for padding and/or margin.</p>
  
  <p>Are there any resources available which discuss it, or can someone explain it here?</p>
  
  <ul>
  <li><a href="http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#attr_android%3alayout_height">android:layout_height</a></li>
  <li><a href="http://developer.android.com/reference/android/widget/TextView.html#attr_android%3aheight">android:height</a></li>
  <li><a href="http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#MATCH_PARENT">LayoutParams</a></li>
  </ul>
  
  <hr>
  
  <h1>Edit (summary of questions):</h1>
  
  <p>It might be the situation I used it in, which was causing an issue, so my <strong>examples from above can be ignored</strong> (I tried in a fresh project and got different results from the combinations of attributes).</p>
  
  <p>But my original questions still apply (some overlaps):</p>
  
  <ol>
  <li>what's the difference between them?</li>
  <li>when should one be used over the other?</li>
  <li>does the use of one affect the use of the other?</li>
  <li>does the use of one have implications over other attributes which can control the measured dimensions of a view, like padding or margin?</li>
  </ol>
  
  <hr>
  
  <p>Edit 2 (an aside):</p>
  
  <p>In case it helps understand my initial situation as compared with the fresh project:</p>
  
  <p>I have an activity which sets <code>windowActionBarOverlay</code> as true, so I get my content flowing under the (translucent) ActionBar.</p>
  
  <p>I also use Croutons, which now were appearing under the ActionBar. Ben Weiss suggested I attach the Crouton to a different ViewGroup, but I wasn't sure which ViewGroup to attach it to.</p>
  
  <p>Instead, I supplied a custom view (which is inflated when it is required) as the Crouton (the TextView from the first part of the question) with a top padding equal to that of the ActionBar, so now it displays vertically below the ActionBar as normal (with other issues for another day).</p>