Will <include> override layout_width / layout_height?
I have a layout XML file named my_layout.xml with the root view layout_width and layout_height specified as 200px.
<com.jlee.demo.MyLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="200px"
android:layout_height="200px">
If i used this xml to be included in another xml and set layout_width and layout_height as 100px.
<include layout="@layout/my_layout"
android:layout_width="100px"
android:layout_height="100px"/>
What would be the real width / height of my_layout?
a source to share
The answer to the top voter on this question should help you:
Does Android XML tag "include" tag actually work?
you can only override parameters that start with layout_. so in your case the layout should be 100 * 100.
a source to share
Overriding android: layout_below doesn't seem to work
If you want to override any layout_ * attributes with a tag, both layout_width and layout_height must be overridden.
See the last lines of the include section at http://developer.android.com/training/improving-layouts/reusing-layouts.html#Include
a source to share