summaryrefslogtreecommitdiffstats
path: root/docs/html/guide
diff options
context:
space:
mode:
authorScott Main <smain@google.com>2010-11-24 16:23:04 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2010-11-24 16:23:04 -0800
commitd4fbcfa2201ead5e22614040e9159b062461c85c (patch)
tree00ea029be0fcf0c937ed50e41f36222426a0aa07 /docs/html/guide
parentf9beaeffef4e8468d2fbf347260b5e89f47d0984 (diff)
parent9e3d14c4aad7e41406f633734973b191c21b5c5c (diff)
downloadframeworks_base-d4fbcfa2201ead5e22614040e9159b062461c85c.zip
frameworks_base-d4fbcfa2201ead5e22614040e9159b062461c85c.tar.gz
frameworks_base-d4fbcfa2201ead5e22614040e9159b062461c85c.tar.bz2
am 9e3d14c4: am 93116f8f: am 3577f51d: docs: clarify <include> layout properties bug: 3227820
* commit '9e3d14c4aad7e41406f633734973b191c21b5c5c': docs: clarify <include> layout properties bug: 3227820
Diffstat (limited to 'docs/html/guide')
-rw-r--r--docs/html/guide/topics/resources/layout-resource.jd10
1 files changed, 8 insertions, 2 deletions
diff --git a/docs/html/guide/topics/resources/layout-resource.jd b/docs/html/guide/topics/resources/layout-resource.jd
index 111851c..36369d3 100644
--- a/docs/html/guide/topics/resources/layout-resource.jd
+++ b/docs/html/guide/topics/resources/layout-resource.jd
@@ -149,17 +149,23 @@ resource.</dd>
</dd>
<dt><code>android:layout_height</code></dt>
<dd><em>Dimension or keyword</em>. Overrides the height given to the root view in the
-included layout.
+included layout. Only effective if <code>android:layout_width</code> is also declared.
</dd>
<dt><code>android:layout_width</code></dt>
<dd><em>Dimension or keyword</em>. Overrides the width given to the root view in the
-included layout.
+included layout. Only effective if <code>android:layout_height</code> is also declared.
</dd>
</dl>
<p>You can include any other layout attributes in the <code>&lt;include&gt;</code> that are
supported by the root element in the included layout and they will override those defined in the
root element.</p>
+ <p class="caution"><strong>Caution:</strong> If you want to override the layout dimensions,
+you must override both <code>android:layout_height</code> and
+<code>android:layout_width</code>&mdash;you cannot override only the height or only the width.
+If you override only one, it will not take effect. (Other layout properties, such as weight,
+are still inherited from the source layout.)</p>
+
<p>Another way to include a layout is to use {@link android.view.ViewStub}. It is a lightweight
View that consumes no layout space until you explicitly inflate it, at which point, it includes a
layout file defined by its {@code android:layout} attribute. For more information about using {@link