diff options
Diffstat (limited to 'docs/html/guide')
-rw-r--r-- | docs/html/guide/topics/resources/layout-resource.jd | 10 |
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><include></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>—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 |