title: How to add padding around a WebView
body: <p>My layout file defines a WebView, underneath which there are some fixed height buttons.  </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:fadingEdge="none"&gt;
  
    &lt;WebView
      android:id="@+id/webview"
      android:layout_width="fill_parent"
      android:layout_height="0dp"
      android:layout_weight="1.0"/&gt;
  
    &lt;LinearLayout
      android:layout_width="fill_parent"
      android:layout_height="60dp"
      android:padding="8dp"&gt;
  
      &lt;Button
        android:text="Decline"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1.0"&gt;
      &lt;/Button&gt;
  
      &lt;Button
        android:text="Accept"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1.0"&gt;
      &lt;/Button&gt;
  
    &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I'm trying to add padding around the WebView, as at the moment the text runs right up to the edge of the UI.  </p>
  
  <p>I tried adding <code>android:padding="8dp"</code> to the WebView, but no padding was added.  I also tried paddingLeft and paddingRight too, but they didn't work either.</p>
  
  <p>The <a href="http://developer.android.com/reference/android/webkit/WebView.html" rel="noreferrer">WebView</a> API docs confirm it inherits from View, which supports the <a href="http://developer.android.com/reference/android/view/View.html#attr_android:padding" rel="noreferrer">android:padding</a> attribute, so I'm surprised this didn't work.  </p>
  
  <p>Does anybody know if this is a known issue, or some interaction of my layout XML that I'm not understanding?  </p>
  
  <p>FYI, my workaround was to put an extra LinearLayout around the WebView, and add the padding to that instead: </p>
  
  <pre><code>  &lt;LinearLayout
      android:layout_width="fill_parent"
      android:layout_height="0dp"
      android:layout_weight="1.0"
      android:padding="8dp"&gt;
  
      &lt;WebView
        android:id="@+id/webview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"/&gt;
  
    &lt;/LinearLayout&gt;
  </code></pre>