I have a layout xml file named my_layout.xml, in which the root view's layout_width and layout_height has been 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 specify the 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?
the top voted answer in this question should help you:
Does Android XML Layout's 'include' Tag Really Work?
you can only override parameters which start with layout_. so in your case, the layout should be 100*100.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With